1 / 101

Searching and Indexing

Searching and Indexing. Thanks to Bill Arms, Marti Hearst. Motivation. Effective search Why indexing Automated indexing crucial Search results Similarity Ranking Importance. Searching and Browsing: The Human in the Loop. Return objects. Return hits. Browse repository. Search index.

spaula
Télécharger la présentation

Searching and Indexing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Searching and Indexing Thanks to Bill Arms, Marti Hearst

  2. Motivation • Effective search • Why indexing • Automated indexing crucial • Search results • Similarity • Ranking • Importance

  3. Searching and Browsing: The Human in the Loop Return objects Return hits Browse repository Search index

  4. Definitions Information retrieval: Subfield of computer and information science that deals with automated retrieval of documents (especially text) based on their content and context. Searching: Seeking for specific information within a body of information. The result of a search is a set of hits. Browsing: Unstructured exploration of a body of information. Linking: Moving from one item to another following links, such as citations, references, etc.

  5. Definitions (continued) Query: A string of text, describing the information that the user is seeking. Each word of the query is called a search term. A query can be a single search term, a string of terms, a phrase in natural language, or a stylized expression using special symbols. Full text searching: Methods that compare the query with every word in the text, without distinguishing the function of the various words. Fielded searching: Methods that search on specific bibliographic or structural fields, such as author or heading.

  6. Web Search: Browsing Users give queries of 2 to 4 words Most users click only on the first few results; few go beyond the fold on the first page 80% of users, use search engine to find sites search to find site browse to find information Amil Singhal, Google, 2004

  7. Browsing in Information Space Starting point x x x x x x x x x x x x x x Effectiveness depends on (a) Starting point (b) Effective feedback (c) Convenience

  8. Designing the Search PageMaking Decisions • Overall organization: • Spacious or cramped • Division of functionality to different pages • Positioning components in the interface • Emphasizing parts of the interface • Query insertion: insert text string or fill in text boxes • Interactivity of search results • Performance requirements

  9. Sorting and Ranking Hits When a user submits a query to a search system, the system returns a set of hits. With a large collection of documents, the set of hits maybe very large. The value to the use depends on the order in which the hits are presented. Three main methods: • Sorting the hits, e.g., by date • Ranking the hits by similarity between query and document • Ranking the hits by the importance of the documents

  10. Indexes Search systems rarely search document collections directly. Instead an index is built of the documents in the collection and the user searches the index. Document collection User Create index Search index Documents can be digital (e.g., web pages) or physical (e.g., books) Index

  11. Automatic indexing The aim of automatic indexing is to build indexes and retrieve information without human intervention. When the information that is being searched is text, methods of automatic indexing can be very effective. History Much of the fundamental research in automatic indexing was carried out by Gerald Salton, Professor at Cornell. Introduced the vector model.

  12. Information Retrieval from Collections of Textual Documents Major Categories of Methods Ranking by similarity to query (vector space model) Exact matching (Boolean) Ranking of matches by importance of documents (PageRank) Combination methods

  13. Text Based Information Retrieval Most ranking methods are based on thevector space model. Most matching methods are based on Boolean operators. Web searchmethods combine vector space model with ranking based on importance of documents. Many practical systems combine features of several approaches. In the basic form, all approaches treat words as separate tokens with minimal attempt to interpret them linguistically.

  14. Documents • A textual document is a digital object consisting of a sequence of words and other symbols, e.g., punctuation. • Take out the sequence and one has a “bag of words” • The individual words and other symbols are known as tokens or terms. • A textual document can be: • • Free text, also known as unstructured text, which is a • continuous sequence of tokens. • • Fielded text, also known as structured text, in which the text • is broken into sections that are distinguished by tags or other • markup.

  15. Word Frequency Observation: Some words are more common than others. Statistics: Most large collections of text documents have similar statistical characteristics. These statistics: • influence the effectiveness and efficiency of data structures used to index documents • many retrieval models rely on them Treat documents as a bag of words

  16. Word Frequency Example The following example is taken from: Jamie Callan, Characteristics of Text, 1997 Sample of 19 million words The next slide shows the 50 commonest words in rank order (r), with their frequency (f).

  17. fff the 1,130,021 from 96,900 or 54,958 of 547,311 he 94,585 about 53,713 to 516,635 million 93,515 market 52,110 a 464,736 year 90,104 they 51,359 in 390,819 its 86,774 this 50,933 and 387,703 be 85,588 would 50,828 that 204,351 was 83,398 you 49,281 for 199,340 company83,070 which 48,273 is 152,483 an 76,974 bank 47,940 said 148,302 has 74,405 stock 47,401 it 134,323 are 74,097 trade 47,310 on 121,173 have 73,132 his 47,116 by 118,863 but 71,887 more 46,244 as 109,135 will 71,494 who 42,142 at 101,779 say 66,807 one 41,635 mr 101,679 new 64,456 their 40,910 with 101,210 share 63,925

  18. Rank Frequency Distribution For all the words in a collection of documents, for each word w f is the frequency that w appears r is rank of w in order of frequency. (The most commonly occurring word has rank 1, etc.) f w has rank r and frequency f r

  19. Rank Frequency Example Normalize the words in Callan's data by total number of word occurrences in the corpus. Define: r is the rank of word w in the sample. f is the frequency of word w in the sample. n is the total number of word occurrences in the sample.

  20. rf*1000/nrf*1000/nrf*1000/n the 59 from 92 or 101 of 58 he 95 about 102 to 82 million 98 market 101 a 98 year 100 they 103 in 103 its 100 this 105 and 122 be 104 would 107 that 75 was 105 you 106 for 84 company 109 which 107 is 72 an 105 bank 109 said 78 has 106 stock 110 it 78 are 109 trade 112 on 77 have 112 his 114 by 81 but 114 more 114 as 80 will 117 who 106 at 80 say 113 one 107 mr 86 new 112 their 108 with 91 share 114

  21. Zipf's Law If the words, w, in a collection are ranked, r, by their frequency, f, they roughly fit the relation: r * f = c Different collections have different constants c. In English text, c tends to be about n / 10, where n is the number of word occurrences in the collection. For a weird but wonderful discussion of this and many other examples of naturally occurring rank frequency distributions, see: Zipf, G. K., Human Behaviour and the Principle of Least Effort. Addison-Wesley, 1949

  22. Methods that Build on Zipf's Law Stop lists: Ignore the most frequent words (upper cut-off). Used by almost all systems. Significant words: Ignore the most frequent and least frequent words (upper and lower cut-off). Rarely used. Term weighting: Give differing weights to terms based on their frequency, with most frequent words weighed less. Used by almost all ranking methods.

  23. Definitions Corpus: A collection of documents that are indexed and searched together. Word list: The set of all terms that are used in the index for a given corpus (also known as a vocabulary file). With full text searching, the word list is all the terms in the corpus, with stop words removed. Related terms may be combined by stemming. Controlled vocabulary: A method of indexing where the word list is fixed. Terms from it are selected to describe each document. Keywords: A name for the terms in the word list, particularly with controlled vocabulary.

  24. Why the interest in Queries? • Queries are ways we interact with IR systems • Nonquery methods? • Types of queries?

  25. Types of Query Structures • Query Models (languages) – most common • Boolean Queries • Extended-Boolean Queries • Natural Language Queries • Vector queries • Others?

  26. Simple query language: Boolean • Earliest query model • Terms + Connectors (or operators) • terms • words • normalized (stemmed) words • phrases • thesaurus terms • connectors • AND • OR • NOT

  27. Similarity Ranking Methods Methods that look for matches (e.g., Boolean) assume that a document is either relevant to a query or not relevant. Similarity ranking methods: measure the degree of similarity between a query and a document. Similar Documents Query Similar: How similar is document to a request?

  28. Similarity Ranking Methods Index database Documents Query Mechanism for determining the similarity of the query to the document. Set of documents ranked by how similar they are to the query

  29. Term Similarity: Example Problem:Given two text documents, how similar are they? [Methods that measure similarity do not assume exact matches.] A documents can be any length from one word to thousands. A query is a special type of document. Example Here are three documents. How similar are they? d1 ant ant bee d2 dog bee dog hog dog ant dog d3 cat gnu dog eel fox

  30. Term Similarity: Basic Concept Two documents are similar if they contain some of the same terms. Possible measures of similarity might take into consideration: (a) The number of terms that are shared (b) Whether the terms are common or unusual (c) How many times each term appears (d) The lengths of the documents

  31. TERM VECTOR SPACE Term vector space n-dimensional space, where n is the number of different terms used to index a set of documents (i.e. size of the word list). Vector Document i is represented by a vector. Its magnitude in dimension j is tij, where: tij > 0 if term j occurs in document i tij = 0 otherwise tij is the weight of term j in document i.

  32. A Document Represented in a 3-Dimensional Term Vector Space t3 d1 t13 t2 t12 t11 t1

  33. Basic Method: Incidence Matrix (Binary Weighting) document text terms d1ant ant beeant bee d2dog bee dog hog dog ant dogant bee dog hog d3cat gnu dog eel foxcat dog eel fox gnu ant bee cat dog eel fox gnu hog d1 1 1 d2 1 1 1 1 d3 1 1 1 1 1 3 vectors in 8-dimensional term vector space Weights: tij = 1 if document i contains term j and zero otherwise

  34. Basic Vector Space Methods: Similarity Similarity The similarity between two documents is a function of the angle between their vectors in the term vector space.

  35. Two Documents Represented in 3-Dimensional Term Vector Space t3 d1 d2 t2  t1

  36. Vector Space Revision x = (x1, x2, x3, ..., xn) is a vector in an n-dimensional vector space Length of x is given by (extension of Pythagoras's theorem) |x|2 = x12 + x22 + x32 + ... + xn2 If x1 and x2 are vectors: Inner product (or dot product) is given by x1.x2 = x11x21 + x12x22 +x13x23 + ... + x1nx2n Cosine of the angle between the vectors x1 and x2: cos () = x1.x2 |x1| |x2|

  37. Example: Comparing Documents (Binary Weighting) ant bee cat dog eel fox gnu hog length d1 1 1 2 d2 1 1 1 1 4 d3 1 1 1 1 1 5

  38. Example: Comparing Documents Similarity of documents in example: d1d2d3 d1 1 0.71 0 d2 0.71 1 0.22 d3 0 0.22 1

  39. Simple Uses of Vector Similarity in Information Retrieval Threshold limit on retrieval For query q, retrieve all documents with similarity above a threshold, e.g., similarity > 0.50. Ranking For query q, return the n most similar documents ranked in order of similarity. [This is the standard practice.]

  40. Similarity of Query to Documents(No Weighting) query qant dog document text terms d1ant ant beeant bee d2dog bee dog hog dog ant dogant bee dog hog d3cat gnu dog eel foxcat dog eel fox gnu ant bee cat dog eel fox gnu hog q 1 1 d1 1 1 d2 1 1 1 1 d3 1 1 1 1 1

  41. Calculate Ranking Similarity of query to documents in example: d1d2d3 q 1/2 1/√2 1/√10 0.5 0.71 0.32 If the query q is searched against this document set, the ranked results are: d2, d1, d3

  42. Weighting: Unnormalized Form of Term Frequency (tf) document text terms d1ant ant beeant bee d2dog bee dog hog dog ant dogant bee dog hog d3cat gnu dog eel foxcat dog eel fox gnu ant bee cat dog eel fox gnu hog length d1 2 1 5 d2 1 1 4 1 19 d3 1 1 1 1 1 5 Weights:tij = frequency that term j occurs in document i

  43. Example (continued) Similarity of documents in example: d1d2d3 d1 1 0.31 0 d2 0.31 1 0.41 d3 0 0.41 1 Similarity depends upon the weights given to the terms. [Note differences in previous results for binary weighting.]

  44. Similarity: Weighting by Unnormalized Form of Term Frequency query qant dog document text terms d1ant ant beeant bee d2dog bee dog hog dog ant dogant bee dog hog d3cat gnu dog eel foxcat dog eel fox gnu ant bee cat dog eel fox gnu hog length q 1 1 √2 d1 2 1 5 d2 1 1 4 1 19 d3 1 1 1 1 1 5

  45. Calculate Ranking Similarity of query to documents in example: d1d2d3 q 2/√10 5/√38 1/√10 0.63 0.81 0.32 If the query q is searched against this document set, the ranked results are: d2, d1, d3

  46. Choice of Weights query qant dog document text terms d1ant ant beeant bee d2dog bee dog hog dog ant dogant bee dog hog d3cat gnu dog eel foxcat dog eel fox gnu ant bee cat dog eel fox gnu hog q ? ? d1? ? d2? ? ? ? d3? ? ? ? ? What weights lead to the best information retrieval?

  47. Evaluation Before we can decide whether one system of weights is better than another, we need systematic and repeatable methods to evaluate methods of information retrieval.

  48. Methods for Selecting Weights Empirical Test a large number of possible weighting schemes with actual data. (Based on work of Salton, et al.) Model based Develop a mathematical model of word distribution and derive weighting scheme theoretically. (Probabilistic model of information retrieval.)

  49. WeightingTerm Frequency (tf) Suppose term j appears fij times in document i. What weighting should be given to a term j? Term Frequency: Concept A term that appears many times within a document is likely to be more important than a term that appears only once.

  50. Normalized Form of Term Frequency: Free-text Document Length of document Unnormalized method is to use fijas the term frequency. ...but, in free-text documents, terms are likely to appear more often in long documents. Therefore fij should be scaled by some variable related to document length.

More Related