efficient indexing of shared content in ir systems andrei broder, nadav eiron, marcus fontoura,...

27
Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene Shekita, Runping Qi

Upload: rodger-hood

Post on 18-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Efficient Indexing of Shared Content in IR

Systems

Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene Shekita, Runping Qi

Page 2: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Motivation IR systems typically use inverted indices to facilitate efficient retrieval

Web, email, news, and other data contains significant amount of duplicated or shared content

Indexing duplicate content is expensive

Page 3: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Scope of Work We assume duplicate or common content is already identified in the corpus

We concern ourselves only with the efficient indexing of such content

Page 4: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Types of Shared Content Web duplicates:

Very common – on the order of 40% of all pages

Email/news threads: Whole messages are often quoted Attachments are duplicated Identical messages in multiple mailboxes

Page 5: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Some Statistics IBM Intranet has about 40% duplicate content. Internet crawls reveal similar statistics

In the Enron email dataset, 61% of messages are in threads. 31% quote other messages verbatim

Page 6: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Naïve Solution 1 :Index Everything Pros:

Simple to implement Semantics are preserved

Cons: Index size blows up Performance penalty (big index + post filtering)

Page 7: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Naïve Solution 2:Index Just One Copy Pros:

Best performance Not too difficult to implement

Cons: Only applies to the duplicates scenario

Semantics are changed, and relevant results may not be returned for a query

Page 8: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

The Web Duplicate Case:Meta Data Vs. ContentRemoval of web duplicates changes the semantics of the query

text

http://almaden.ibm.com/...

text

http://watson.ibm.com/...

Query: text url:watson

Page 9: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Our Solution Content is split to shared and private parts

Shared content is indexed only once

Private content (such as metadata in the Web duplicates case) is indexed for each document

Index provides virtual cursors that simulate having all content indexed

Page 10: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Advantages Index size, build time, and query efficiency

Precise semantics No need for post-filtering

Page 11: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Inverted Indices Index is sorted by term For each term, a sorted list of documents in which it appears is maintained (postings list)

Each occurrence (posting) contains additional payload

T1: <docid1,payload>, <docid2,payload>…T2: <docid1,payload>, <docid2,payload>…

Page 12: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Document Sharing Model Each document is partitioned into private and shared content. The two types are differentiated by posting payload

Documents exist in a tree – shared content is shared with all descendents

Document IDs (and hence index order) are dictated by a DFS traversal of document trees

Page 13: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

The Document Tree

Content is shared from ancestor to descendants:

<1,s>

1

2

3

4

5 6

<1, p>

<2, p>

<3, p>

<2, s>

Page 14: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Example:

docid = 1: From: andreiTo: ronny, marcusdid you read it?

docid = 2: From: ronnyTo: marcusdid you, marcus?

docid = 3: From: marcusTo: ronnynot yet!

andrei: <1, p>did: <1, s>, <2, s>it: <1, s>marcus: <1, p>, <2, p>, <2, s>, <3, p>not: <3, s>read: <1, s>ronny: <1, p>,<2, p>, <3, p>yet: <3, s>you: <1, s>, <2, s>

Documents Inverted index posting lists

1

2

3

4

5 6

Page 15: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Querying Inverted Indexes Queries contain mandatory terms, forbidden terms, and optional terms (such as +term1 –term2)

Typically a zigzag algorithm is used Uses cursors on postings list. Cursors support two operations: next() – Moves to the next posting fwdBeyond(d) – Moves to the first posting for a document with id >= d

Page 16: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Top Level Query Algorithm1. while (more results required) {2. Invoke zigzag algorithm3. Forward optional term cursors4. Score document5. Advance required/forbidden

cursors6. }

In our solution, this algorithm, uses virtual cursors

Page 17: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Additional Information In The Index

Tree information is encoded by two attributes for each document: root(d) – The docid for the document at the root of the tree containing d

lastDescendent(d) – The highest-numbered document that is a descendent of d

Page 18: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Physical Cursor AdditionphysicalCursor::fwdShare(d)1. while (this.docid<=d and

this.docid does not share content with d) {

2. r=root(d);3. l=lastDescendant(this.docid);4. if (this.docid<r) {5. this.fwdBeyond(r);6. } else if (l<d) {7. this.fwdBeyond(l+1);8. } else this.next();9. }

Page 19: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

fwdShared(d) example:

1

2

3 4

5

6

7

8

9 10

p

p

p

s s

fwdShared(10)fwdBeyond(root(10))Next()fwdBeyond(lastDescendent(6)+1)

T:<1,p>, <3,p>, <5,p>, <6,s>, <8,s>

Page 20: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Virtual Cursors Two types of cursors:

Regular (positive) virtual cursors. These behave as if all shared content was indexed for all documents that contain it

Negated virtual cursors, represent the complement of the postings list (used for forbidden terms)

Implemented on top of a physical cursor

Page 21: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Virtual Cursor MethodsVirtualCursor::next()1. l=lastDescendant(Cp.do

cid)2. if (Cp.payload ==

shared and this.docid<l)

3. this.docid++;4. else {5. Cp.next();6.

this.docid=Cp.docid;7. }

VirtualCursor::fwdBeyond(d)

1. if (this.docid>=d)2. return;3. Cp.fwdShare(d);4. this.docid =

max(Cp.docid,d);

Page 22: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Virtual Positive CursorsMaintain a physical and logical positions. Support next() and fwdBeyond(d)

1

2

3 4

5

6

7

8

9 10

p

p

p

s s

next()fwdBeyond(10)

Page 23: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Virtual Negative CursorsSupport next() and fwdBeyond(d). Physical cursor ahead of logical cursor.

1

2

3 4

5

6

7

8

9 10

p

p

p

s

next()fwdBeyond(7)

p

Page 24: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Web Duplicates ApplicationTrees are flat, with the masters at the root. Leaves only have private content:

docid = 1root = 1lastDescendant = 4

docid = 2root = 1lastDescendant = 2

docid = 3root = 1lastDescendant = 3

docid = 4root = 1lastDescendant = 4

S1 P1

P2 P3 P4

docid = 6root = 5lastDescendant = 6

S5 P5

P6

Page 25: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Build Performance EvaluationSubsets of IBM Intranet (36-44% dups):

# docs IS1 (GB)

IS2 (GB)

Space saved

IT1 (s)

IT2 (s)

Speedup

500K 2.5 3.6 31% 540 780 31%

1000K 5.1 7.4 31% 1020 1440 29%

1500K 7.1 11.0 36% 1500 2340 36%

2000K 8.8 13.0 32% 1800 2940 39%

2500K 11.0 16.0 31% 2160 3540 39%

Page 26: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Runtime Performance: Single Terms Queries

2339

4038

5602

7101

8492

118210328426554330

3000

6000

9000

0.2 0.4 0.6 0.8 1Selectivity

Time (ms)

MI

DI

Page 27: Efficient Indexing of Shared Content in IR Systems Andrei Broder, Nadav Eiron, Marcus Fontoura, Michael Herscovici, Ronny Lempel, John McPherson, Eugene

Runtime Performance: Two Term Queries

0

300

600

900

+research+hr

+research-hr

+hr +url:w3 +hr -url:w3

Time (ms)

MI

DI