PrasadL06IndexConstruction1 Index Construction Adapted from Lectures by Prabhakar Raghavan (Yahoo and Stanford) and Christopher Manning (Stanford)

Slides:



Advertisements
Similar presentations
CS276 Lecture 5. Plan Last lecture: Tolerant retrieval Wildcards Spell correction Soundex This time: Index construction.
Advertisements

Lecture 4: Index Construction
Introduction to Information Retrieval Introduction to Information Retrieval CS276: Information Retrieval and Web Search Pandu Nayak and Prabhakar Raghavan.
MAP REDUCE PROGRAMMING Dr G Sudha Sadasivam. Map - reduce sort/merge based distributed processing Best for batch- oriented processing Sort/merge is primitive.
Index Construction David Kauchak cs160 Fall 2009 adapted from:
Srihari-CSE535-Spring2008 CSE 535 Information Retrieval Lecture 2: Boolean Retrieval Model.
Hinrich Schütze and Christina Lioma Lecture 4: Index Construction
PrasadL06IndexConstruction1 Index Construction Adapted from Lectures by Prabhakar Raghavan (Google) and Christopher Manning (Stanford)
Indexes. Primary Indexes Dense Indexes Pointer to every record of a sequential file, (ordered by search key). Can make sense because records may be much.
Information Retrieval IR 4. Plan This time: Index construction.
CS347 Lecture 3 April 16, 2001 ©Prabhakar Raghavan.
1 INF 2914 Information Retrieval and Web Search Lecture 6: Index Construction These slides are adapted from Stanford’s class CS276 / LING 286 Information.
Query Expansion and Index Construction Lecture 5.
CpSc 881: Information Retrieval. 2 Hardware basics Many design decisions in information retrieval are based on hardware constraints. We begin by reviewing.
PrasadL3InvertedIndex1 Inverted Index Construction Adapted from Lectures by Prabhakar Raghavan (Yahoo and Stanford) and Christopher Manning (Stanford)
Hinrich Schütze and Christina Lioma Lecture 4: Index Construction
Lecture 4 Index construction
INF 2914 Information Retrieval and Web Search
Indexing Debapriyo Majumdar Information Retrieval – Spring 2015 Indian Statistical Institute Kolkata.
CSCI 5417 Information Retrieval Systems Jim Martin Lecture 4 9/1/2011.
Introduction to Information Retrieval Information Retrieval and Data Mining (AT71.07) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor:
Introduction to Information Retrieval (Manning, Raghavan, Schutze) Chapter 1 Boolean retrieval.
Index Construction David Kauchak cs458 Fall 2012 adapted from:
Document Indexing: SPIMI
LIS618 lecture 2 the Boolean model Thomas Krichel
ADFOCS 2004 Prabhakar Raghavan Lecture 2. Corpus size for estimates Consider n = 1M documents, each with about 1K terms. Avg 6 bytes/term incl spaces/punctuation.
©Silberschatz, Korth and Sudarshan13.1Database System Concepts Chapter 13: Query Processing Overview Measures of Query Cost Selection Operation Sorting.
Introduction to Information Retrieval Introduction to Information Retrieval CS276 Information Retrieval and Web Search Christopher Manning and Prabhakar.
An Introduction to IR Lecture 4 Index construction 1.
Index Construction 1 Lecture 5: Index Construction Web Search and Mining.
Index Construction (Modified from Stanford CS276 Class Lecture 4 Index construction)
CS276A Text Information Retrieval, Mining, and Exploitation Lecture 3 8 Oct 2002.
1 ITCS 6265 Lecture 4 Index construction. 2 Plan Last lecture: Dictionary data structures Tolerant retrieval Wildcards Spell correction Soundex This lecture:
Introduction to Information Retrieval Introduction to Information Retrieval CS276 Information Retrieval and Web Search Pandu Nayak and Prabhakar Raghavan.
Index construction 4장4장. Plan Tolerant retrieval Wildcards Spell correction Soundex This time: Index construction.
Index Construction: sorting Paolo Ferragina Dipartimento di Informatica Università di Pisa Reading Chap 4.
1. L01: Corpuses, Terms and Search Basic terminology The need for unstructured text search Boolean Retrieval Model Algorithms for compressing data Algorithms.
Introduction to Information Retrieval Introduction to Information Retrieval Lecture 4: Index Construction Related to Chapter 4:
Introduction to Information Retrieval COMP4210: Information Retrieval and Search Engines Lecture 4: Index Construction United International College.
Introduction to Information Retrieval Introduction to Information Retrieval CS276: Information Retrieval and Web Search Christopher Manning and Prabhakar.
Lecture 4: Index Construction Related to Chapter 4:
Introduction to Information Retrieval Introduction to Information Retrieval Lecture 4: Index Construction Related to Chapter 4:
MapReduce: Simplified Data Processing on Large Clusters By Dinesh Dharme.
Introduction to Information Retrieval Introduction to Information Retrieval Modified from Stanford CS276 slides Chap. 4: Index Construction.
Information Retrieval On the use of the Inverted Lists.
Introduction to Information Retrieval CSE 538 MRS BOOK – CHAPTER IV Index Construction 1.
Introduction to Information Retrieval Introduction to Information Retrieval Introducing Information Retrieval and Web Search.
CS276 Lecture 4 Index construction. Plan Last lecture: Tolerant retrieval Wildcards Spell correction Soundex This time: Index construction.
CS315 Introduction to Information Retrieval Boolean Search 1.
Introduction to Information Retrieval Introduction to Information Retrieval Lecture 7: Index Construction.
Information Retrieval and Data Mining (AT71. 07) Comp. Sc. and Inf
Index Construction Some of these slides are based on Stanford IR Course slides at
Why indexing? For efficient searching of a document
Prof. Paolo Ferragina, Algoritmi per "Information Retrieval"
Large Scale Search: Inverted Index, etc.
Chapter 4 Index construction
Modified from Stanford CS276 slides Lecture 4: Index Construction
Lecture 7: Index Construction
CS276: Information Retrieval and Web Search
Index Construction: sorting
Lecture 7: Index Construction
Lecture 2- Query Processing (continued)
Discussion 5 Sara Javanmardi.
3-2. Index construction Most slides were adapted from Stanford CS 276 course and University of Munich IR course.
Lecture 4: Index Construction
Index construction 4장.
CS276: Information Retrieval and Web Search
INFORMATION RETRIEVAL TECHNIQUES BY DR. ADNAN ABID
Presentation transcript:

PrasadL06IndexConstruction1 Index Construction Adapted from Lectures by Prabhakar Raghavan (Yahoo and Stanford) and Christopher Manning (Stanford)

2 Index construction How do we construct an index? What strategies can we use with limited main memory? Our Sample Corpus Number of docs = n = 1M Each doc has 1K terms Number of distinct terms = m = 500K 667 million postings entries

3 Documents are parsed to extract words and these are saved with the Document ID. I did enact Julius Caesar I was killed i' the Capitol; Brutus killed me. Doc 1 So let it be with Caesar. The noble Brutus hath told you Caesar was ambitious Doc 2 Recall index construction

4 Key step After all documents have been parsed the inverted file is sorted by terms. We focus on this sort step. We have 667M items to sort.

5 Index construction As we build up the index, cannot exploit compression tricks Parse docs one at a time. Final postings for any term – incomplete until the end. (actually you can exploit compression, but this becomes a lot more complex) At bytes per postings entry, demands several temporary gigabytes

6 System parameters for design Disk seek ~ 10 milliseconds Block transfer from disk ~ 1 microsecond per byte (following a seek) All other ops ~ 10 microseconds E.g., compare two postings entries and decide their merge order

7 Bottleneck Parse and build postings entries one doc at a time Now sort postings entries by term (then by doc within each term) Doing this with random disk seeks would be too slow – must sort N=667M records If every comparison took 2 disk seeks, and N items could be sorted with N log 2 N comparisons, how long would this take?

8 Sorting with fewer disk seeks 12-byte (4+4+4) records (term, doc, freq). These are generated as we parse docs. Must now sort 667M such 12-byte records by term. Define a Block ~ 10M such records can “easily” fit a couple into memory. Will have 64 such blocks to start with. Will sort within blocks first, then merge the blocks into one long sorted order.

9 Sorting 64 blocks of 10M records First, read each block and sort within: Quicksort takes 2N ln N expected steps In our case 2 x (10M ln 10M) steps Exercise: estimate total time to read each block from disk and quicksort it. Exercise: estimate total time to read each block from disk and quicksort it. 64 times this estimate - gives us 64 sorted runs of 10M records each. Need 2 copies of data on disk, throughout.

10 Merging 64 sorted runs Merge tree of log 2 64= 6 layers. During each layer, read into memory runs in blocks of 10M, merge, write back. Disk Runs being merged. Merged run.

11 Merge tree … … Sorted runs runs, 20M/run 16 runs, 40M/run 8 runs, 80M/run 4 runs … ? 2 runs … ? 1 run … ? Bottom level of tree.

12 Merging 64 runs Time estimate for disk transfer: 6 x (64runs x 120MB x sec) x 2 ~ 25hrs. Disk block transfer time. Why is this an Overestimate? Work out how these transfers are staged, and the total time for merging. # Layers in merge tree Read + Write

13 Exercise - fill in this table TimeStep 64 initial quicksorts of 10M records each Read 2 sorted blocks for merging, write back Merge 2 sorted blocks Add (2) + (3) = time to read/merge/write 64 times (4) = total merge time ?

14 Large memory indexing Suppose instead that we had 16GB of memory for the above indexing task. Exercise: What initial block sizes would we choose? What index time does this yield?

15 Distributed indexing For web-scale indexing (don’t try this at home!): must use a distributed computing cluster Individual machines are fault-prone Can unpredictably slow down or fail How do we exploit such a pool of machines?

16 Distributed indexing Maintain a master machine directing the indexing job – considered “safe”. Break up indexing into sets of (parallel) tasks. Master machine assigns each task to an idle machine from a pool.

17 Parallel tasks We will use two sets of parallel tasks Parsers Inverters Break the input document corpus into splits Each split is a subset of documents Master assigns a split to an idle parser machine Parser reads a document at a time and emits (term, doc) pairs

18 Parallel tasks Parser writes pairs into j partitions Each for a range of terms’ first letters (e.g., a-f, g-p, q-z) – here j=3. Now to complete the index inversion

19 Data flow splits Parser Master a-fg-pq-z a-fg-pq-z a-fg-pq-z Inverter Postings a-f g-p q-z assign

20 Inverters Collect all (term, doc) pairs for a partition Sorts and writes to postings list Each partition contains a set of postings Above process flow a special case of MapReduce.

21 Dynamic indexing Docs come in over time postings updates for terms already in dictionary new terms added to dictionary Docs get deleted

22 Simplest approach Maintain “big” main index New docs go into “small” auxiliary index Search across both, merge results Deletions Invalidation bit-vector for deleted docs Filter docs output on a search result by this invalidation bit-vector Periodically, re-index into one main index

23 Index on disk vs. memory Most retrieval systems keep the dictionary in memory and the postings on disk Web search engines frequently keep both in memory massive memory requirement feasible for large web service installations less so for commercial usage where query loads are lighter

24 Indexing in the real world Typically, don’t have all documents sitting on a local filesystem Documents need to be spidered Could be dispersed over a WAN with varying connectivity Must schedule distributed spiders Have already discussed distributed indexers Could be (secure content) in Databases Content management applications applications

25 Content residing in applications Mail systems/groupware, content management contain the most “valuable” documents http often not the most efficient way of fetching these documents - native API fetching Specialized, repository-specific connectors These connectors also facilitate document viewing when a search result is selected for viewing

26 Secure documents Each document is accessible to a subset of users Usually implemented through some form of Access Control Lists (ACLs) Search users are authenticated Query should retrieve a document only if user can access it So if there are docs matching your search but you’re not privy to them, “Sorry no results found” E.g., as a lowly employee in the company, I get “No results” for the query “salary roster”

27 Users in groups, docs from groups Index the ACLs and filter results by them Often, user membership in an ACL group verified at query time – slowdown Users Documents 0/1 0 if user can’t read doc, 1 otherwise.

28 “Rich” documents (How) Do we index images? Researchers have devised Query Based on Image Content (QBIC) systems “show me a picture similar to this orange circle” (see, vector space retrieval) In practice, image search usually based on meta- data such as file name e.g., monalisa.jpg New approaches exploit social tagging E.g., flickr.com

29 Passage/sentence retrieval Suppose we want to retrieve not an entire document matching a query, but only a passage/sentence - say, in a very long document Can index passages/sentences as mini- documents – what should the index units be? This is the subject of XML search