Presentation is loading. Please wait.

Presentation is loading. Please wait.

Algoritmi per IR Ranking. The big fight: find the best ranking...

Similar presentations


Presentation on theme: "Algoritmi per IR Ranking. The big fight: find the best ranking..."— Presentation transcript:

1 Algoritmi per IR Ranking

2 The big fight: find the best ranking...

3 Ranking: Google vs Google.cn

4 Algoritmi per IR Text-based Ranking (1° generation)

5 Similarity between binary vectors Document is binary vector X,Y in {0,1} D Score: overlap measure What’s wrong ?

6 Normalization Dice coefficient (wrt avg #terms) : Jaccard coefficient (wrt possible terms) : OK, triangular NO, triangular

7 What’s wrong in doc-similarity ? Overlap matching doesn’t consider: Term frequency in a document Talks more of t ? Then t should be weighted more. Term scarcity in collection of commoner than baby bed Length of documents score should be normalized

8 A famous “weight”: tf-idf Frequency of term t in doc d = #occ t / |d| tf t,d where n t = #docs containing term t n = #docs in the indexed collection log n n idf t t         Vector Space model

9 Why distance is a bad idea Sec. 6.3

10 A graphical example Postulate: Documents that are “close together” in the vector space talk about the same things. Euclidean distance sensible to vector length !! t1t1 d2d2 d1d1 d3d3 d4d4 d5d5 t3t3 t2t2  cos(  ) = v  w / ||v|| * ||w|| The user query is a very short doc Easy to Spam Sophisticated algos to find top-k docs for a query Q

11 cosine(query,document) Dot product q i is the tf-idf weight of term i in the query d i is the tf-idf weight of term i in the document cos(q,d) is the cosine similarity of q and d … or, equivalently, the cosine of the angle between q and d. Sec. 6.3

12 Cos for length-normalized vectors For length-normalized vectors, cosine similarity is simply the dot product (or scalar product): for q, d length-normalized. 12

13 Cosine similarity amongst 3 documents termSaSPaPWH affection1155820 jealous10711 gossip206 wuthering0038 How similar are the novels SaS: Sense and Sensibility PaP: Pride and Prejudice, and WH: Wuthering Heights? Term frequencies (counts) Sec. 6.3 Note: To simplify this example, we don’t do idf weighting.

14 3 documents example contd. Log frequency weighting termSaSPaPWH affection3.062.762.30 jealous2.001.852.04 gossip1.3001.78 wuthering002.58 After length normalization termSaSPaPWH affection0.7890.8320.524 jealous0.5150.5550.465 gossip0.33500.405 wuthering000.588 cos(SaS,PaP) ≈ 0.789 × 0.832 + 0.515 × 0.555 + 0.335 × 0.0 + 0.0 × 0.0 ≈ 0.94 cos(SaS,WH) ≈ 0.79 cos(PaP,WH) ≈ 0.69 Why do we have cos(SaS,PaP) > cos(SAS,WH)? Sec. 6.3

15 Vector spaces and other operators Vector space OK for bag-of-words queries Clean metaphor for similar-document queries Not a good combination with operators: Boolean, wild-card, positional, proximity First generation of search engines Invented before “spamming” web search

16 Algoritmi per IR Top-k retrieval

17 Speed-up top-k retrieval Costly is the computation of the cos Find a set A of contenders, with K < |A| << N A does not necessarily contain the top K, but has many docs from among the top K Return the top K docs in A, according to the score The same approach is also used for other (non- cosine) scoring functions Will look at several schemes following this approach Sec. 7.1.1

18 Index elimination Consider docs containing at least one query term. Hence this means… Take this further: 1. Only consider high-idf query terms 2. Only consider docs containing many query terms Sec. 7.1.2

19 High-idf query terms only For a query such as catcher in the rye Only accumulate scores from catcher and rye Intuition: in and the contribute little to the scores and so don’t alter rank-ordering much Benefit: Postings of low-idf terms have many docs  these (many) docs get eliminated from set A of contenders Sec. 7.1.2

20 Docs containing many query terms For multi-term queries, compute scores for docs containing several of the query terms Say, at least 3 out of 4 Imposes a “soft conjunction” on queries seen on web search engines (early Google) Easy to implement in postings traversal Sec. 7.1.2

21 3 of 4 query terms Brutus Caesar Calpurnia 12358132134 248163264128 1316 Antony 348163264128 32 Scores only computed for docs 8, 16 and 32. Sec. 7.1.2

22 Champion Lists Preprocess: Assign to each term, its m best documents Search: If |Q| = q terms, merge their preferred lists (  mq answers). Compute COS between Q and these docs, and choose the top k. Need to pick m>k to work well empirically. Now SE use tf-idf PLUS PageRank (PLUS other weights)

23 Complex scores Consider a simple total score combining cosine relevance and authority net-score(q,d) = PR(d) + cosine(q,d) Can use some other linear combination than an equal weighting Now we seek the top K docs by net score Sec. 7.1.4

24 Advanced: Fancy-hits heuristic Preprocess: Assign docID by decreasing PR weight Define FH(t) = m docs for t with highest tf-idf weight Define IL(t) = the rest (i.e. incr docID = decr PR weight) Idea: a document that scores high should be in FH or in the front of IL Search for a t-term query: First FH: Take the common docs of their FH compute the score of these docs and keep the top-k docs. Then IL: scan ILs and check the common docs Compute the score and possibly insert them into the top-k. Stop when M docs have been checked or the PR score becomes smaller than some threshold.

25 Algoritmi per IR Speed-up querying by clustering

26 Visualization Query LeaderFollower Sec. 7.1.6

27 Cluster pruning: preprocessing Pick  N docs at random: call these leaders For every other doc, pre-compute nearest leader Docs attached to a leader: its followers; Likely: each leader has ~  N followers. Sec. 7.1.6

28 Cluster pruning: query processing Process a query as follows: Given query Q, find its nearest leader L. Seek K nearest docs from among L’s followers. Sec. 7.1.6

29 Why use random sampling Fast Leaders reflect data distribution Sec. 7.1.6

30 General variants Have each follower attached to b 1 =3 (say) nearest leaders. From query, find b 2 =4 (say) nearest leaders and their followers. Can recur on leader/follower construction. Sec. 7.1.6

31 Algoritmi per IR Relevance feedback

32 Relevance Feedback Relevance feedback: user feedback on relevance of docs in initial set of results User issues a (short, simple) query The user marks some results as relevant or non-relevant. The system computes a better representation of the information need based on feedback. Relevance feedback can go through one or more iterations. Sec. 9.1

33 Rocchio’s Algorithm The Rocchio algorithm uses the vector space model to pick a relevance feed-back query Rocchio seeks the query q opt that maximizes Sec. 9.1.1

34 Rocchio (SMART) Used in practice: D r = set of known relevant doc vectors D nr = set of known irrelevant doc vectors q m = modified query vector; q 0 = original query vector; α, β, γ : weights (hand-chosen or set empirically) New query moves toward relevant documents and away from irrelevant documents Sec. 9.1.1

35 Relevance Feedback: Problems Users are often reluctant to provide explicit feedback It’s often harder to understand why a particular document was retrieved after applying relevance feedback There is no clear evidence that relevance feedback is the “best use” of the user’s time.

36 Relevance Feedback on the Web Some search engines offer a similar/related pages feature (this is a trivial form of relevance feedback) Google (link-based) Altavista Stanford WebBase Some don’t because it’s hard to explain to users: Alltheweb bing Yahoo Excite initially had true relevance feedback, but abandoned it due to lack of use. α / β / γ ?? Sec. 9.1.4

37 Pseudo relevance feedback Pseudo-relevance feedback automates the “manual” part of true relevance feedback. Retrieve a list of hits for the user’s query Assume that the top k are relevant. Do relevance feedback (e.g., Rocchio) Works very well on average But can go horribly wrong for some queries. Several iterations can cause query drift. Sec. 9.1.6

38 Query Expansion In relevance feedback, users give additional input (relevant/non-relevant) on documents, which is used to reweight terms in the documents In query expansion, users give additional input (good/bad search term) on words or phrases Sec. 9.2.2

39 How augment the user query? Manual thesaurus (costly to generate) E.g. MedLine: physician, syn: doc, doctor, MD Global Analysis (static; all docs in collection) Automatically derived thesaurus (co-occurrence statistics) Refinements based on query-log mining Common on the web Local Analysis (dynamic) Analysis of documents in result set Sec. 9.2.2

40 Query assist Would you expect such a feature to increase the query volume at a search engine?

41 Algoritmi per IR Zone indexes

42 Parametric and zone indexes Thus far, a doc has been a term sequence But documents have multiple parts: Author Title Date of publication Language Format etc. These are the metadata about a document Sec. 6.1

43 Zone A zone is a region of the doc that can contain an arbitrary amount of text e.g., Title Abstract References … Build inverted indexes on fields AND zones to permit querying E.g., “find docs with merchant in the title zone and matching the query gentle rain” Sec. 6.1

44 Example zone indexes Encode zones in dictionary vs. postings. Sec. 6.1

45 Tiered indexes Break postings up into a hierarchy of lists Most important … Least important Inverted index thus broken up into tiers of decreasing importance At query time use top tier unless it fails to yield K docs If so drop to lower tiers Sec. 7.2.1

46 Example tiered index Sec. 7.2.1

47 Query term proximity Free text queries: just a set of terms typed into the query box – common on the web Users prefer docs in which query terms occur within close proximity of each other Would like scoring function to take this into account – how? Sec. 7.2.2

48 Query parsers E.g. query rising interest rates Run the query as a phrase query If <K docs contain the phrase rising interest rates, run the two phrase queries rising interest and interest rates If we still have <K docs, run the vector space query rising interest rates Rank matching docs by vector space scoring Sec. 7.2.3

49 Algoritmi per IR Quality of a Search Engine

50 Is it good ? How fast does it index Number of documents/hour (Average document size) How fast does it search Latency as a function of index size Expressiveness of the query language

51 Measures for a search engine All of the preceding criteria are measurable The key measure: user happiness …useless answers won’t make a user happy

52 Happiness: elusive to measure Commonest approach is given by the relevance of search results How do we measure it ? Requires 3 elements: 1.A benchmark document collection 2.A benchmark suite of queries 3.A binary assessment of either Relevant or Irrelevant for each query-doc pair

53 Evaluating an IR system Standard benchmarks TREC: National Institute of Standards and Testing (NIST) has run large IR testbed for many years Other doc collections: marked by human experts, for each query and for each doc, Relevant or Irrelevant  On the Web everything is more complicated since we cannot mark the entire corpus !!

54 General scenario Relevant Retrieved collection

55 Precision: % docs retrieved that are relevant [issue “junk” found] Precision vs. Recall Relevant Retrieved collection Recall: % docs relevant that are retrieved [issue “info” found]

56 How to compute them Precision: fraction of retrieved docs that are relevant Recall: fraction of relevant docs that are retrieved Precision P = tp/(tp + fp) Recall R = tp/(tp + fn) RelevantNot Relevant Retrievedtp (true positive) fp (false positive) Not Retrievedfn (false negative) tn (true negative)

57 Some considerations Can get high recall (but low precision) by retrieving all docs for all queries! Recall is a non-decreasing function of the number of docs retrieved Precision usually decreases

58 Precision-Recall curve We measures Precision at various levels of Recall Note: it is an AVERAGE over many queries precision recall x x x x

59 A common picture precision recall x x x x

60 F measure Combined measure (weighted harmonic mean) : People usually use balanced F 1 measure i.e., with  = ½ thus 1/F = ½ (1/P + 1/R) Use this if you need to optimize a single measure that balances precision and recall.

61 Information Retrieval Recommendation Systems

62 Recommendations We have a list of restaurants with  and  ratings for some Which restaurant(s) should I recommend to Dave?

63 Basic Algorithm Recommend the most popular restaurants say # positive votes minus # negative votes What if Dave does not like Spaghetti?

64 Smart Algorithm Basic idea: find the person “most similar” to Dave according to cosine-similarity (i.e. Estie), and then recommend something this person likes. Perhaps recommend Straits Cafe to Dave  Do you want to rely on one person’s opinions?


Download ppt "Algoritmi per IR Ranking. The big fight: find the best ranking..."

Similar presentations


Ads by Google