DOC PREVIEW
UT Dallas CS 6359 - Lecture4

This preview shows page 1-2-3-23-24-25-26-46-47-48 out of 48 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 48 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 48 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 48 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 48 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 48 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 48 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 48 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 48 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 48 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 48 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 48 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS6322: CS6322: Information Retrieval Information Retrieval SandaSandaHarabagiuHarabagiuLecture 4: Index ConstructionLecture 4: Index ConstructionCS 6322 Information RetrievalCS 6322 Information RetrievalPlan Last lecture: Dictionary data structures Tolerant retrieval Wildcards Spell correction Soundex This time: Index constructiona-huhy-mn-zmoonamong$m maceabandonamortizemaddenamongCS 6322 Information RetrievalCS 6322 Information RetrievalIndex construction How do we construct an index? What strategies can we use with limited main memory?Ch. 4CS 6322 Information RetrievalCS 6322 Information RetrievalHardware basics Many design decisions in information retrieval are based on the characteristics of hardware We begin by reviewing hardware basicsSec. 4.1CS 6322 Information RetrievalCS 6322 Information RetrievalHardware basics Access to data in memory is much faster than access to data on disk. Disk seeks: No data is transferred from disk while the disk head is being positioned. Therefore: Transferring one large chunk of data from disk to memory is faster than transferring many small chunks. Disk I/O is block-based: Reading and writing of entire blocks (as opposed to smaller chunks). Block sizes: 8KB to 256 KB.Sec. 4.1CS 6322 Information RetrievalCS 6322 Information RetrievalHardware basics Servers used in IR systems now typically have several GB of main memory, sometimes tens of GB.  Available disk space is several (2–3) orders of magnitude larger. Fault tolerance is very expensive: It’s much cheaper to use many regular machines rather than one fault tolerant machine.Sec. 4.1CS 6322 Information RetrievalCS 6322 Information RetrievalHardware assumptions symbol statistic value s average seek time 5 ms = 5 x 10−3s b transfer time per byte 0.02 μs = 2 x 10−8s processor’s clock rate 109s−1 p low-level operation 0.01 μs = 10−8s(e.g., compare & swap a word) size of main memory several GB size of disk space 1 TB or moreSec. 4.1CS 6322 Information RetrievalCS 6322 Information RetrievalRCV1: Our collection for this lecture Shakespeare’s collected works definitely aren’t large enough for demonstrating many of the points in this course. The collection we’ll use isn’t really large enough either, but it’s publicly available and is at least a more plausible example. As an example for applying scalable index construction algorithms, we will use the Reuters RCV1 collection. This is one year of Reuters newswire (part of 1995 and 1996)Sec. 4.2Introduction to Information RetrievalIntroduction to Information RetrievalA Reuters RCV1 documentSec. 4.2CS 6322 Information RetrievalCS 6322 Information RetrievalReuters RCV1 statistics symbol statistic value N documents 800,000 L avg. # tokens per doc 200 M terms (= word types) 400,000 avg. # bytes per token 6(incl. spaces/punct.) avg. # bytes per token 4.5(without spaces/punct.) avg. # bytes per term 7.5 non-positional postings 100,000,0004.5 bytes per word token vs. 7.5 bytes per word type: why?Sec. 4.2CS 6322 Information RetrievalCS 6322 Information Retrieval Documents are parsed to extract words and these are saved with the Document ID.I did enact JuliusCaesar I was killed i' the Capitol; Brutus killed me.Doc 1So let it be withCaesar. The nobleBrutus hath told youCaesar was ambitiousDoc 2Recall IIR 1 index constructionTerm Doc #I 1did 1enact 1julius 1caesar 1I 1was 1killed 1i' 1the 1capitol 1brutus 1killed 1me 1so 2let 2it 2be 2with 2caesar 2the 2noble 2brutus 2hath 2told 2you 2caesar 2was 2ambitious 2Sec. 4.2CS 6322 Information RetrievalCS 6322 Information RetrievalTerm Doc #I 1did 1enact 1julius 1caesar 1I 1was 1killed 1i' 1the 1capitol 1brutus 1killed 1me 1so 2let 2it 2be 2with 2caesar 2the 2noble 2brutus 2hath 2told 2you 2caesar 2was 2ambitious 2Term Doc #ambitious 2be 2brutus 1brutus 2capitol 1caesar 1caesar 2caesar 2did 1enact 1hath 1I 1I 1i' 1it 2julius 1killed 1killed 1let 2me 1noble 2so 2the 1the 2told 2you 2was 1was 2with 2Key step After all documents have been parsed, the inverted file is sorted by terms. We focus on this sort step.We have 100M items to sort.Sec. 4.2CS 6322 Information RetrievalCS 6322 Information RetrievalScaling index construction In-memory index construction does not scale. How can we construct an index for very large collections? Taking into account the hardware constraints we just learned about . . . Memory, disk, speed, etc.Sec. 4.2CS 6322 Information RetrievalCS 6322 Information RetrievalSort-based index construction As we build the index, we parse docs one at a time. While building the index, we cannot easily exploit compression tricks (you can, but much more complex) The final postings for any term are incomplete until the end. At 12 bytes per non-positional postings entry (term, doc, freq), demands a lot of space for large collections. T = 100,000,000 in the case of RCV1 So … we can do this in memory in 2009, but typical collections are much larger. E.g. the New York Times provides an index of >150 years of newswire Thus: We need to store intermediate results on disk.Sec. 4.2CS 6322 Information RetrievalCS 6322 Information RetrievalUse the same algorithm for disk? Can we use the same index construction algorithm for larger collections, but by using disk instead of memory? No: Sorting T = 100,000,000 records on disk is too slow – too many disk seeks. We need an external sorting algorithm.Sec. 4.2CS 6322 Information RetrievalCS 6322 Information RetrievalBottleneck 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 T=100M recordsIf every comparison took 2 disk seeks, and N items could besorted with N log2N comparisons, how long would this take?Sec. 4.2CS 6322 Information RetrievalCS 6322 Information RetrievalBSBI: Blocked sort-based Indexing (Sorting with fewer disk seeks) 12-byte (4+4+4) records (term, doc, freq). These are generated as we parse docs. Must now sort 100M such 12-byte records by term. Define a Block ~ 10M such records Can easily fit a couple into memory. Will have 10 such blocks to start with. Basic idea of algorithm: Accumulate postings for each block, sort, write to disk. Then merge the blocks into one long sorted


View Full Document

UT Dallas CS 6359 - Lecture4

Documents in this Course
Lecture2

Lecture2

63 pages

Lecture3

Lecture3

49 pages

Lecture5

Lecture5

47 pages

Lecture6

Lecture6

45 pages

Lecture7

Lecture7

63 pages

Lecture8

Lecture8

77 pages

Lecture9

Lecture9

48 pages

Lecture10

Lecture10

84 pages

Lecture11

Lecture11

45 pages

Lecture12

Lecture12

134 pages

Lecture13

Lecture13

62 pages

Lecture14

Lecture14

76 pages

Project

Project

2 pages

Chapter_1

Chapter_1

25 pages

Load more
Download Lecture4
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture4 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture4 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?