The Web document collection No design/co-ordination I Unstructured - - PDF document

the web document collection
SMART_READER_LITE
LIVE PREVIEW

The Web document collection No design/co-ordination I Unstructured - - PDF document

Web Data Management Advanced Topics in Database Management (INFSCI 2711) Textbooks: Database System Concepts - 2010 Introduction to Information Retrieval - 2008 Vladimir Zadorozhny, DINS, SCI, University of Pittsburgh The Web document


slide-1
SLIDE 1

1

Advanced Topics in Database Management (INFSCI 2711)

Textbooks: Database System Concepts - 2010 Introduction to Information Retrieval - 2008

Vladimir Zadorozhny, DINS, SCI, University of Pittsburgh

Web Data Management

The Web document collection

I

No design/co-ordination

I

Unstructured (text, html, …), semi-structured (XML, annotated photos), structured (Databases)…

I

Distributed content creation, linking, democratization of publishing

I

Content includes truth, lies, obsolete information, contradictions …

I

Scale much larger than previous text collections

I

Growth – slowed down from initial “volume doubling every few months” but still expanding

I

Content can be dynamically generated

The Web

slide-2
SLIDE 2

2

Web search basics

The Web Ad indexes

Web

Results 1 - 10 of about 7,310,000 for miele. (0.12 seconds) Miele, Inc -- Anything else is a compromise At the heart of your home, Appliances by Miele. ... USA. to miele.com. Residential Appliances. Vacuum Cleaners. Dishwashers. Cooking Appliances. Steam Oven. Coffee System ... www.miele.com/ - 20k - Cached - Similar pages Miele Welcome to Miele, the home of the very best appliances and kitchens in the world. www.miele.co.uk/ - 3k - Cached - Similar pages Miele - Deutscher Hersteller von Einbaugeräten, Hausgeräten ... - [ Translate this page ] Das Portal zum Thema Essen & Geniessen online unter www.zu-tisch.de. Miele weltweit ...ein Leben lang. ... Wählen Sie die Miele Vertretung Ihres Landes. www.miele.de/ - 10k - Cached - Similar pages Herzlich willkommen bei Miele Österreich - [ Translate this page ] Herzlich willkommen bei Miele Österreich Wenn Sie nicht automatisch weitergeleitet werden, klicken Sie bitte hier! HAUSHALTSGERÄTE ... www.miele.at/ - 3k - Cached - Similar pages Sponsored Links CG Appliance Express Discount Appliances (650) 756-3931 Same Day Certified Installation www.cgappliance.com San Francisco-Oakland-San Jose, CA Miele Vacuum Cleaners Miele Vacuums- Complete Selection Free Shipping! www.vacuums.com Miele Vacuum Cleaners Miele-Free Air shipping! All models. Helpful advice. www.best-vacuum.com

Web spider

Indexer Indexes

Search

User

How far do people look for results?

(Source: iprospect.com WhitePaper_2006_SearchEngineUserBehavior.pdf)

slide-3
SLIDE 3

3

How good are the retrieved docs?

I

Precision : Fraction of retrieved docs that are relevant to user’s information need

I

Recall : Fraction of relevant docs in collection that are retrieved

G On the web, recall seldom matters

I

What matters

G Precision at 1? Precision above the fold? G Recall matters when the number of matches is very small G Quality of pages varies widely, relevance is not enough 4 Content: Trustworthy, diverse, non-duplicated, well maintained 4 Web readability: display correctly & fast 4 No annoyances: pop-ups, etc 5

Distributed indexing

I

For web-scale indexing must use a distributed computing cluster

I

Individual machines are fault-prone

G Can unpredictably slow down or fail

I

How do we exploit such a pool of machines?

I

Example: Google data centers

G Mainly contain commodity machines. G Data centers are distributed around the world. G Estimate: a total of 1 million servers, 3 million processors/cores

(2007)

G Estimate: Google installs 100,000 servers each quarter. 4 Based on expenditures of 200–250 million dollars per year G If in a non-fault-tolerant system with 1000 nodes, each node has

99.9% uptime, what is the uptime of the system? Answer: 63%

G What about number of servers failing per minute for an installation

  • f 1 million servers?
slide-4
SLIDE 4

4

Implementation of Distributed indexing

I

Maintain a master machine directing the indexing job – considered “safe”.

I

Break up indexing into sets of (parallel) tasks.

I

Master machine assigns each task to an idle machine from a pool.

Term-partitioned vs Document-partitioned Index

I

Index construction was just one phase.

I

Another phase: transforming a term-partitioned index into document- partitioned index.

G Term-partitioned: one machine handles a subrange of terms G Document-partitioned: one machine handles a subrange of

documents

I

Most search engines use a document-partitioned index.

slide-5
SLIDE 5

5

Ranked retrieval

I

Thus far, our queries have all been Boolean.

G Documents either match or don’t.

I

Good for expert users with precise understanding of their needs and the collection.

I

Also good for applications: Applications can easily consume 1000s of results.

G Not good for the majority of users. G Most users incapable of writing Boolean queries (or they are, but

they think it’s too much work).

I

Most users don’t want to wade through 1000s of results.

G This is particularly true of web search.

Problem with Boolean search

I

Boolean queries often result in either too few (=0) or too many (1000s) results.

I

Query 1: “standard user dlink 650” → 200,000 hits

I

Query 2: “standard user dlink 650 no card found”: 0 hits

I

It takes skill to come up with a query that produces a manageable number of hits.

I

With a ranked list of documents it does not matter how large the retrieved set is.

slide-6
SLIDE 6

6

Query-document matching scores

I

We need a way of assigning a score to a query/document pair

I

Let’s start with a one-term query

I

If the query term does not occur in the document: score should be 0

I

The more frequent the query term in the document, the higher the score (should be)

I

We will look at a number of alternatives for this.

Recall: Binary term-document incidence matrix

Antony and Cleopatra Julius Caesar The Tempest Hamlet Othello Macbeth Antony

1 1 1 Brutus 1 1 1 Caesar 1 1 1 1 1 Calpurnia 1 Cleopatra 1 mercy 1 1 1 1 1 worser 1 1 1 1

Each document is represented by a binary vector ∈ {0,1}|V|

slide-7
SLIDE 7

7

Term-document count matrices

I

Consider the number of occurrences of a term in a document:

G Each document is a count vector in ℕv: a column below

Antony and Cleopatra Julius Caesar The Tempest Hamlet Othello Macbeth Antony

157 73 Brutus 4 157 1 Caesar 232 227 2 1 1 Calpurnia 10 Cleopatra 57 mercy 2 3 5 5 1 worser 2 1 1 1

Term frequency tf

I

The term frequency tft,d of term t in document d is defined as the number of times that t occurs in d.

I

We want to use tf when computing query-document match scores. But how?

I

Raw term frequency is not what we want:

G A document with 10 occurrences of the term is more relevant than

a document with one occurrence of the term.

G But not 10 times more relevant.

I

Relevance does not increase proportionally with term frequency.

slide-8
SLIDE 8

8

Log-frequency weighting

I

The log frequency weight of term t in d is

I

0 → 0, 1 → 1, 2 → 1.3, 10 → 2, 1000 → 4, etc.

I

Score for a document-query pair: sum over terms t in both q and d:

I

The score is 0 if none of the query terms is present in the document.

Document frequency

I

Rare terms are more informative than frequent terms

I

Consider a term in the query that is rare in the collection (e.g., arachnocentric)

I

A document containing this term is very likely to be relevant to the query arachnocentric

I

We want a high weight for rare terms like arachnocentric.

I

We will use document frequency (df) to capture this in the score.

I

df (£ N) is the number of documents that contain the term

slide-9
SLIDE 9

9

idf weight

I

dft is the document frequency of t: the number of documents that contain t

G df is a measure of the informativeness of t

I

We define the idf (inverse document frequency) of t by

G We use log N/dft instead of N/dft to “dampen” the effect of idf.

t t

N/df log idf

10

=

idf example, suppose N= 1 million

term dft idft calpurnia 1 6 animal 100 4 sunday 1,000 3 fly 10,000 2 under 100,000 1 the 1,000,000

There is one idf value for each term t in a collection.

slide-10
SLIDE 10

10

Collection vs. Document frequency

I

The collection frequency of t is the number of occurrences of t in the collection, counting multiple occurrences.

I

Example:

I

Which word is a better search term (and should get a higher weight)?

Word Collection frequency Document frequency insurance 10440 3997 try 10422 8760

tf-idf weighting

I

The tf-idf weight of a term is the product of its tf weight and its idf weight.

I

Best known weighting scheme in information retrieval

I

Alternative names: tf.idf, tf x idf

I

Increases with the number of occurrences within a document

I

Increases with the rarity of the term in the collection

t d t

N

d t

df / log ) tf log 1 ( w

10 ,

,

´ + =

slide-11
SLIDE 11

11

Binary → count → weight matrix

Antony and Cleopatra Julius Caesar The Tempest Hamlet Othello Macbeth Antony

5.25 3.18 0.35 Brutus 1.21 6.1 1 Caesar 8.59 2.54 1.51 0.25 Calpurnia 1.54 Cleopatra 2.85 mercy 1.51 1.9 0.12 5.25 0.88 worser 1.37 0.11 4.15 0.25 1.95

Each document is now represented by a real-valued vector of tf-idf weights ∈ R|V|

Documents as vectors

I

So we have a |V|-dimensional vector space

I

Terms are axes of the space

I

Documents are points or vectors in this space

I

Very high-dimensional: hundreds of millions of dimensions when you apply this to a web search engine

I

This is a very sparse vector - most entries are zero.

slide-12
SLIDE 12

12

Queries

I

Represent queries as vectors in the space

I

Rank documents according to their proximity to the query in this space

I

proximity = similarity of vectors

I

Query result: more relevant documents will be ranked higher than less relevant documents

Vector space proximity ?

I

Distance between the end points of the two vectors ?

The distance between q and d2 is large even though the distribution of terms in the query q and the distribution of terms in the document d2 are very similar. Use angle instead of distance If d and d′ have the same content the angle between the two documents is 0, corresponding to maximal similarity. Rank documents according to angle with query.

slide-13
SLIDE 13

13

From angles to cosines

I

The following two notions are equivalent.

G Rank documents in decreasing order of the angle between query

and document

G Rank documents in increasing order of cosine(query,document)

I

Cosine is a monotonically decreasing function for the interval [0o, 180o] qi is the tf-idf weight of term i in the query di 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.

Cosine similarity amongst 3 documents

term SaS PaP WH affection 115 58 20 jealous 10 7 11 gossip 2 6 wuthering 38

How similar are the novels SaS: Sense and Sensibility PaP: Pride and Prejudice, and WH: Wuthering Heights?

Term frequencies (counts)

slide-14
SLIDE 14

14

3 documents example contd.

Log frequency weighting

term SaS PaP WH affection 3.06 2.76 2.30 jealous 2.00 1.85 2.04 gossip 1.30 1.78 wuthering 2.58

After normalization

term SaS PaP WH affection 0.789 0.832 0.524 jealous 0.515 0.555 0.465 gossip 0.335 0.405 wuthering 0.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

Summary

I

Represent the query as a weighted tf-idf vector

I

Represent each document as a weighted tf-idf vector

I

Compute the cosine similarity score for the query vector and each document vector

I

Rank documents with respect to the query by score

I

Return the top K (e.g., K = 10) to the user

I

Many search engines allow for different weightings for queries vs documents