Information Retrieval and Web Search

Slides:



Advertisements
Similar presentations
Advanced topics in Computer Science Jiaheng Lu Department of Computer Science Renmin University of China
Advertisements

Chapter 5: Introduction to Information Retrieval
Introduction to Information Retrieval
Introduction to Information Retrieval Introduction to Information Retrieval Hinrich Schütze and Christina Lioma Lecture 1: Boolean Retrieval 1.
CS276A Text Retrieval and Mining Lecture 1. Query Which plays of Shakespeare contain the words Brutus AND Caesar but NOT Calpurnia? One could grep all.
Adapted from Information Retrieval and Web Search
Srihari-CSE535-Spring2008 CSE 535 Information Retrieval Lecture 2: Boolean Retrieval Model.
Boolean Retrieval Lecture 2: Boolean Retrieval Web Search and Mining.
Introduction to Information Retrieval Introduction to Information Retrieval Introducing Information Retrieval and Web Search.
Chapter 7: Text mining UIC - CS 594 Bing Liu 1 1.
Information Retrieval
CS276 Information Retrieval and Web Search Lecture 1: Boolean retrieval.
Information Retrieval using the Boolean Model. Query Which plays of Shakespeare contain the words Brutus AND Caesar but NOT Calpurnia? Could grep all.
PrasadL3InvertedIndex1 Inverted Index Construction Adapted from Lectures by Prabhakar Raghavan (Yahoo and Stanford) and Christopher Manning (Stanford)
Introducing Information Retrieval and Web Search
Chapter 5: Information Retrieval and Web Search
PrasadL3InvertedIndex1 Inverted Index Construction Adapted from Lectures by Prabhakar Raghavan (Yahoo and Stanford) and Christopher Manning (Stanford)
Introduction to Information Retrieval (Manning, Raghavan, Schutze) Chapter 1 Boolean retrieval.
Information Retrieval and Data Mining (AT71. 07) Comp. Sc. and Inf
LIS618 lecture 2 the Boolean model Thomas Krichel
Introduction to Information Retrieval Introduction to Information Retrieval Modified from Stanford CS276 slides Chap. 1: Boolean retrieval.
Modern Information Retrieval Lecture 3: Boolean Retrieval.
Chapter 6: Information Retrieval and Web Search
Introduction to Information Retrieval Introduction to Information Retrieval COMP4201 Information Retrieval and Search Engines Lecture 1 Boolean retrieval.
Introduction to Digital Libraries hussein suleman uct cs honours 2003.
Introduction to Information Retrieval Introduction to Information Retrieval Information Retrieval and Web Search Lecture 1: Introduction and Boolean retrieval.
Web Search. Crawling Start from some root site e.g., Yahoo directories. Traverse the HREF links. Search(initialLink) fringe.Insert( initialLink ); loop.
Introduction to Information Retrival Slides are adapted from stanford CS276.
IR Paolo Ferragina Dipartimento di Informatica Università di Pisa.
ITCS 6265 IR & Web Mining ITCS 6265/8265: Advanced Topics in KDD --- Information Retrieval and Web Mining Lecture 1 Boolean retrieval UNC Charlotte, Fall.
Text Retrieval and Text Databases Based on Christopher and Raghavan’s slides.
Introduction to Information Retrieval Introduction to Information Retrieval CS276 Information Retrieval and Web Search Pandu Nayak and Prabhakar Raghavan.
Introduction to Information Retrieval Introduction to Information Retrieval CS276 Information Retrieval and Web Search Christopher Manning and Prabhakar.
CES 514 – Data Mining Lec 2, Feb 10 Spring 2010 Sonoma State University.
1 CS276 Information Retrieval and Web Search Lecture 1: Introduction.
Introduction to Information Retrieval CSE 538 MRS BOOK – CHAPTER I Boolean Model 1.
Information Retrieval Lecture 1. Query Which plays of Shakespeare contain the words Brutus AND Caesar but NOT Calpurnia? Could grep all of Shakespeare’s.
Introduction to Information Retrieval Introduction to Information Retrieval CS276 Information Retrieval and Web Search Christopher Manning and Prabhakar.
Web Mining ( 網路探勘 ) WM06 TLMXM1A Wed 8,9 (15:10-17:00) U705 Information Retrieval and Web Search ( 資訊檢索與網路搜尋 ) Min-Yuh Day 戴敏育 Assistant Professor.
1. L01: Corpuses, Terms and Search Basic terminology The need for unstructured text search Boolean Retrieval Model Algorithms for compressing data Algorithms.
1 Information Retrieval LECTURE 1 : Introduction.
Introduction to Information Retrieval Introduction to Information Retrieval Modified from Stanford CS276 slides Chap. 1: Boolean retrieval.
Introduction to Information Retrieval Introduction to Information Retrieval cs160 Introduction David Kauchak adapted from:
Introduction to Information Retrieval Boolean Retrieval.
CS276 Information Retrieval and Web Search Lecture 1: Boolean retrieval.
Introduction to Information Retrieval Introduction to Information Retrieval Lecture 1: Boolean retrieval.
Information Retrieval and Web Search Boolean retrieval Instructor: Rada Mihalcea (Note: some of the slides in this set have been adapted from a course.
Web Information Retrieval Textbook by Christopher D. Manning, Prabhakar Raghavan, and Hinrich Schutze Notes Revised by X. Meng for SEU May 2014.
Introduction to Information Retrieval Introduction to Information Retrieval Introducing Information Retrieval and Web Search.
Introduction to Information Retrieval Introducing Information Retrieval and Web Search.
Module 2: Boolean retrieval. Introduction to Information Retrieval Information Retrieval  Information Retrieval (IR) is finding material (usually documents)
Data e Web Mining. - S. Orlando 1 Information Retrieval and Web Search Salvatore Orlando Bing Liu. “Web Data Mining: Exploring Hyperlinks, Contents”, and.
CS315 Introduction to Information Retrieval Boolean Search 1.
Take-away Administrativa
Information Retrieval : Intro
Large Scale Search: Inverted Index, etc.
CS122B: Projects in Databases and Web Applications Winter 2017
COIS 442 Foundations on IR Information Retrieval and Web Search
Slides from Book: Christopher D
정보 검색 특론 Information Retrieval and Web Search
Boolean Retrieval.
Information Retrieval and Data Mining (AT71. 07) Comp. Sc. and Inf
Boolean Retrieval.
Information Retrieval and Web Search Lecture 1: Boolean retrieval
Boolean Retrieval.
Introduction to Information Retrieval
Chapter 5: Information Retrieval and Web Search
CS276 Information Retrieval and Web Search
Introducing Information Retrieval and Web Search
Information Retrieval and Web Design
Presentation transcript:

Information Retrieval and Web Search Adopted from Slides from Bin Liu @UIC & Christopher Manning and Prabhakar Raghavan @ Stanford

Introduction Text mining refers to data mining using text documents as data. Most text mining tasks use Information Retrieval (IR) methods to pre-process text documents. These methods are quite different from traditional data pre-processing methods used for relational tables. Web search also has its root in IR.

Information Retrieval (IR) Conceptually, IR is the study of finding needed information. I.e., IR helps users find information that matches their information needs. Expressed as queries Historically, IR is about document retrieval, emphasizing document as the basic unit. Finding documents relevant to user queries Technically, IR studies the acquisition, organization, storage, retrieval, and distribution of information.

IR architecture

IR queries Keyword queries Boolean queries (using AND, OR, NOT) Phrase queries Proximity queries Full document queries Natural language questions

Information retrieval models An IR model governs how a document and a query are represented and how the relevance of a document to a user query is defined. Main models: Boolean model Vector space model Statistical language model etc

Boolean model Each document or query is treated as a “bag” of words or terms. Word sequence is not considered. Given a collection of documents D, let V = {t1, t2, ..., t|V|} be the set of distinctive words/terms in the collection. V is called the vocabulary. A weight wij > 0 is associated with each term ti of a document dj ∈ D. For a term that does not appear in document dj, wij = 0. dj = (w1j, w2j, ..., w|V|j),

Boolean model (contd) Query terms are combined logically using the Boolean operators AND, OR, and NOT. E.g., ((data AND mining) AND (NOT text)) Retrieval Given a Boolean query, the system retrieves every document that makes the query logically true. Called exact match. The retrieval results are usually quite poor because term frequency is not considered.

Boolean queries: Exact match Sec. 1.3 Boolean queries: Exact match The Boolean retrieval model is being able to ask a query that is a Boolean expression: Boolean Queries are queries using AND, OR and NOT to join query terms Views each document as a set of words Is precise: document matches condition or not. Perhaps the simplest model to build an IR system on Primary commercial retrieval tool for 3 decades. Many search systems you still use are Boolean: Email, library catalog, Mac OS X Spotlight

Example: WestLaw http://www.westlaw.com/ Sec. 1.4 Example: WestLaw http://www.westlaw.com/ Largest commercial (paying subscribers) legal search service (started 1975; ranking added 1992) Tens of terabytes of data; 700,000 users Majority of users still use boolean queries Example query: What is the statute of limitations in cases involving the federal tort claims act? LIMIT! /3 STATUTE ACTION /S FEDERAL /2 TORT /3 CLAIM /3 = within 3 words, /S = in same sentence

Example: WestLaw http://www.westlaw.com/ Sec. 1.4 Example: WestLaw http://www.westlaw.com/ Another example query: Requirements for disabled people to be able to access a workplace disabl! /p access! /s work-site work-place (employment /3 place Note that SPACE is disjunction, not conjunction! Long, precise queries; proximity operators; incrementally developed; not like web search Many professional searchers still like Boolean search You know exactly what you are getting But that doesn’t mean it actually works better….

Vector space model Documents are also treated as a “bag” of words or terms. Each document is represented as a vector. However, the term weights are no longer 0 or 1. Each term weight is computed based on some variations of TF or TF-IDF scheme. Term Frequency (TF) Scheme: The weight of a term ti in document dj is the number of times that ti appears in dj, denoted by fij. Normalization may also be applied.

TF-IDF term weighting scheme The most well known weighting scheme TF: still term frequency IDF: inverse document frequency. N: total number of docs dfi: the number of docs that ti appears. The final TF-IDF term weight is:

Retrieval in vector space model Query q is represented in the same way or slightly differently. Relevance of di to q: Compare the similarity of query q and document di. Cosine similarity (the cosine of the angle between the two vectors) Cosine is also commonly used in text clustering

An Example A document space is defined by three terms: hardware, software, users the vocabulary A set of documents are defined as: A1=(1, 0, 0), A2=(0, 1, 0), A3=(0, 0, 1) A4=(1, 1, 0), A5=(1, 0, 1), A6=(0, 1, 1) A7=(1, 1, 1) A8=(1, 0, 1). A9=(0, 1, 1) If the Query is “hardware and software” what documents should be retrieved?

An Example (cont.) In Boolean query matching: document A4, A7 will be retrieved (“AND”) retrieved: A1, A2, A4, A5, A6, A7, A8, A9 (“OR”) In similarity matching (cosine): q=(1, 1, 0) S(q, A1)=0.71, S(q, A2)=0.71, S(q, A3)=0 S(q, A4)=1, S(q, A5)=0.5, S(q, A6)=0.5 S(q, A7)=0.82, S(q, A8)=0.5, S(q, A9)=0.5 Document retrieved set (with ranking)= {A4, A7, A1, A2, A5, A6, A8, A9}

Okapi relevance method Another way to assess the degree of relevance is to directly compute a relevance score for each document to the query. The Okapi method and its variations are popular techniques in this setting.

Relevance feedback Relevance feedback is one of the techniques for improving retrieval effectiveness. The steps: the user first identifies some relevant (Dr) and irrelevant documents (Dir) in the initial list of retrieved documents the system expands the query q by extracting some additional terms from the sample relevant and irrelevant documents to produce qe Perform a second round of retrieval. Rocchio method (α, β and γ are parameters)

Rocchio text classifier In fact, a variation of the Rocchio method above, called the Rocchio classification method, can be used to improve retrieval effectiveness too so are other machine learning methods. Why? Rocchio classifier is constructed by producing a prototype vector ci for each class i (relevant or irrelevant in this case): In classification, cosine is used.

Text pre-processing Word (term) extraction: easy Stopwords removal Stemming Frequency counts and computing TF-IDF term weights. 4

Stopwords removal stopwords accounts 20-30% of total word counts. Many of the most frequently used words in English are useless in IR and text mining – these words are called stop words. the, of, and, to, …. Typically about 400 to 500 such words For an application, an additional domain specific stopwords list may be constructed Why do we need to remove stopwords? Reduce indexing (or data) file size stopwords accounts 20-30% of total word counts. Improve efficiency and effectiveness stopwords are not useful for searching or text mining they may also confuse the retrieval system.

Stemming Techniques used to find out the root/stem of a word. E.g., user engineering users engineered used engineer using stem: use engineer Usefulness: improving effectiveness of IR and text mining matching similar words Mainly improve recall reducing indexing size combing words with same roots may reduce indexing size as much as 40-50%.

Basic stemming methods Using a set of rules. E.g., remove ending if a word ends with a consonant other than s, followed by an s, then delete s. if a word ends in es, drop the s. if a word ends in ing, delete the ing unless the remaining word consists only of one letter or of th. If a word ends with ed, preceded by a consonant, delete the ed unless this leaves only a single letter. …... transform words if a word ends with “ies” but not “eies” or “aies” then “ies --> y.”

Frequency counts + TF-IDF Counts the number of times a word occurred in a document. Using occurrence frequencies to indicate relative importance of a word in a document. if a word appears often in a document, the document likely “deals with” subjects related to the word. Counts the number of documents in the collection that contains each word TF-IDF can be computed.

Evaluation: Precision and Recall Given a query: Are all retrieved documents relevant? Have all the relevant documents been retrieved? Measures for system performance: The first question is about the precision of the search The second is about the completeness (recall) of the search.

Precision-recall curve

Compare different retrieval algorithms

Compare with multiple queries Compute the average precision at each recall level. Draw precision recall curves Do not forget the F-score evaluation measure.

Rank precision Compute the precision values at some selected rank positions. Mainly used in Web search evaluation. For a Web search engine, we can compute precisions for the top 5, 10, 15, 20, 25 and 30 returned pages as the user seldom looks at more than 30 pages. Recall is not very meaningful in Web search. Why?

Web Search as a huge IR system A Web crawler (robot) crawls the Web to collect all the pages. Servers establish a huge inverted indexing database and other indexing databases At query (search) time, search engines conduct different types of vector query matching.

Inverted index The inverted index of a document collection is basically a data structure that attaches each distinctive term with a list of all documents that contains the term. Thus, in retrieval, it takes constant time to find the documents that contains a query term. multiple query terms are also easy handle as we will see soon.

An example

Index construction Easy! See the example,

Search using inverted index Given a query q, search has the following steps: Step 1 (vocabulary search): find each term/word in q in the inverted index. Step 2 (results merging): Merge results to find documents that contain all or some of the words/terms in q. Step 3 (Rank score computation): To rank the resulting documents/pages, using, content-based ranking link-based ranking

Inverted index: Details Sec. 1.2 Inverted index: Details For each term t, we must store a list of all documents that contain t. Identify each by a docID, a document serial number Can we used fixed-size arrays for this? Brutus 1 2 4 11 31 45 173 174 Caesar 1 2 4 5 6 16 57 132 Calpurnia 2 31 54 101 What happens if the word Caesar is added to document 14?

Inverted index We need variable-size postings lists Brutus Caesar Sec. 1.2 Inverted index We need variable-size postings lists On disk, a continuous run of postings is normal and best In memory, can use linked lists or variable length arrays Some tradeoffs in size/ease of insertion Posting Brutus 1 2 4 11 31 45 173 174 Dictionary Linked lists generally preferred to arrays Dynamic space allocation Insertion of terms into documents easy Space overhead of pointers Caesar 1 2 4 5 6 16 57 132 Calpurnia 2 31 54 101 Postings Sorted by docID (more later on why).

Inverted index construction Sec. 1.2 Inverted index construction Documents to be indexed. Friends, Romans, countrymen. Tokenizer Token stream. Friends Romans Countrymen Linguistic modules Modified tokens. friend roman countryman Indexer Inverted index. friend roman countryman 2 4 13 16 1

Indexer steps: Token sequence Sec. 1.2 Indexer steps: Token sequence Sequence of (Modified token, Document ID) pairs. Doc 1 Doc 2 I did enact Julius Caesar I was killed i' the Capitol; Brutus killed me. So let it be with Caesar. The noble Brutus hath told you Caesar was ambitious

Indexer steps: Sort Sort by terms And then docID Core indexing step Sec. 1.2 Indexer steps: Sort Sort by terms And then docID Core indexing step

Indexer steps: Dictionary & Postings Sec. 1.2 Indexer steps: Dictionary & Postings Multiple term entries in a single document are merged. Split into Dictionary and Postings Doc. frequency information is added. Why frequency?

Where do we pay in storage? Sec. 1.2 Where do we pay in storage? Lists of docIDs Terms and counts How do we index efficiently? How much storage do we need? Pointers

Query processing: AND Consider processing the query: Brutus AND Caesar Sec. 1.3 Query processing: AND Consider processing the query: Brutus AND Caesar Locate Brutus in the Dictionary; Retrieve its postings. Locate Caesar in the Dictionary; “Merge” the two postings: 2 4 8 16 32 64 128 Brutus 1 2 3 5 8 13 21 34 Caesar

Sec. 1.3 The merge Walk through the two postings simultaneously, in time linear in the total number of postings entries 34 128 2 4 8 16 32 64 1 3 5 13 21 2 4 8 16 32 64 128 Brutus Caesar 2 8 1 2 3 5 8 13 21 34 If the list lengths are x and y, the merge takes O(x+y) operations. Crucial: postings sorted by docID.

Intersecting two postings lists (a “merge” algorithm)

Query optimization What is the best order for query processing? Sec. 1.3 Query optimization What is the best order for query processing? Consider a query that is an AND of n terms. For each of the n terms, get its postings, then AND them together. Brutus 2 4 8 16 32 64 128 Caesar 1 2 3 5 8 16 21 34 Calpurnia 13 16 Query: Brutus AND Calpurnia AND Caesar 45

Query optimization example Sec. 1.3 Query optimization example Process in order of increasing freq: start with smallest set, then keep cutting further. This is why we kept document freq. in dictionary Brutus 2 4 8 16 32 64 128 Caesar 1 2 3 5 8 16 21 34 Calpurnia 13 16 Execute the query as (Calpurnia AND Brutus) AND Caesar.

Boolean queries: More general merges Sec. 1.3 Boolean queries: More general merges Exercise: Adapt the merge for the queries: Brutus AND NOT Caesar Brutus OR NOT Caesar Can we still run through the merge in time O(x+y)? What can we achieve?

Merging What about an arbitrary Boolean formula? Sec. 1.3 Merging What about an arbitrary Boolean formula? (Brutus OR Caesar) AND NOT (Antony OR Cleopatra) Can we always merge in “linear” time? Linear in what? Can we do better?

More general optimization Sec. 1.3 More general optimization e.g., (madding OR crowd) AND (ignoble OR strife) Get doc. freq.’s for all terms. Estimate the size of each OR by the sum of its doc. freq.’s (conservative). Process in increasing order of OR sizes.

Exercise (tangerine OR trees) AND (marmalade OR skies) AND Recommend a query processing order for (tangerine OR trees) AND (marmalade OR skies) AND (kaleidoscope OR eyes)

Different search engines The real differences among different search engines are their index weighting schemes Including location of terms, e.g., title, body, emphasized words, etc. their query processing methods (e.g., query classification, expansion, etc) their ranking algorithms Few of these are published by any of the search engine companies. They aretightly guarded secrets.

Summary We only give a VERY brief introduction to IR. There are a large number of other topics, e.g., Statistical language model Latent semantic indexing (LSI and SVD). (read an IR book or take an IR course) Many other interesting topics are not covered, e.g., Web search Index compression Ranking: combining contents and hyperlinks Web page pre-processing Combining multiple rankings and meta search Web spamming Want to know more? Read the textbook