1 chapter 21: information retrieval. ©silberschatz, korth and sudarshan19.2database system concepts...
TRANSCRIPT
1
Chapter 21: Information RetrievalChapter 21: Information Retrieval
©Silberschatz, Korth and Sudarshan19.2Database System Concepts - 5th Edition, Sep 2, 2005
Information Retrieval SystemsInformation Retrieval Systems
Information retrieval (IR) systems use a simpler data model than database systems
Information organized as a collection of documents
Documents are unstructured, no schema
Information retrieval locates relevant documents, on the basis of user input such as keywords or example documents
e.g., find documents containing the words “database systems”
Information retrieval can be used even on textual descriptions provided with non-textual data such as images
Web search engines are the most familiar example of IR systems
©Silberschatz, Korth and Sudarshan19.3Database System Concepts - 5th Edition, Sep 2, 2005
Information Retrieval Systems (Cont.)Information Retrieval Systems (Cont.)
Differences from database systems
IR systems don’t deal with transactional updates (including concurrency control and recovery)
Database systems deal with structured data, with schemas that define the data organization
IR systems deal with some querying issues not generally addressed by database systems
Approximate searching by keywords
Ranking of retrieved answers by estimated degree of relevance
©Silberschatz, Korth and Sudarshan19.4Database System Concepts - 5th Edition, Sep 2, 2005
Keyword SearchKeyword Search In full text retrieval, all the words in each document are considered to be keywords.
We use the word term to refer to the words in a document Information-retrieval systems typically allow query expressions formed using
keywords and the logical connectives and, or, and not “ands” are implicit, even if not explicitly specified
Ranking of documents on the basis of estimated relevance to a query is critical Relevance ranking is based on factors such as
Term frequency (TF)
– Frequency of occurrence of query keyword in document Inverse document frequency (IDF)
– 1 / number of documents that contains the query keyword» Fewer give more importance to keyword
Hyperlinks to documents
– More links to a document document is more important
©Silberschatz, Korth and Sudarshan19.5Database System Concepts - 5th Edition, Sep 2, 2005
Relevance Ranking using TermsRelevance Ranking using Terms
TF-IDF (Term Frequency / Inverse Document Frequency) ranking:
Let n(d) = number of terms in the document d
n(d, t) = number of occurrences of term t in the document d.
Relevance of a document d to a term t
One naïve way of defining TF: Just count the number of occurrencies
The number of occurences depends on the length of the document
A document containing 10 occurrences of a term may not be 10 times as relevant as a document containing one word
nn((dd))
nn((dd, , tt))TF TF ((dd, , tt) = ) =
©Silberschatz, Korth and Sudarshan19.6Database System Concepts - 5th Edition, Sep 2, 2005
Relevance Ranking using Terms (cont.)Relevance Ranking using Terms (cont.)
TF-IDF (Term Frequency / Inverse Document Frequency) ranking:
Let n(d) = number of terms in the document d
n(d, t) = number of occurrences of term t in the document d.
Relevance of a document d to a term t
The log factor is to avoid excessive weight to frequent terms
IDF
n(t) is number of documents containing term t
Relevance of a document d to a query Q
nn((dd))
nn((dd, , tt))1 +1 +TF TF ((dd, , tt) = ) = log log ( )( )
r r ((dd, , QQ) =) = TF TF ((dd, , tt))
nn((tt))ttQQ ==
TF TF ((dd, , tt) * ) * IDF(t)IDF(t)ttQQ
IDF(t) = 1 / IDF(t) = 1 / nn((tt))
©Silberschatz, Korth and Sudarshan19.7Database System Concepts - 5th Edition, Sep 2, 2005
Relevance Ranking using Terms (Cont.)Relevance Ranking using Terms (Cont.)
Most systems add the following tips to the above TF model
Words that occur in title, author list, section headings, etc. are given greater importance
Words whose first occurrence is late in the document are given lower importance
Very common words such as “a”, “the”, “it” (stop words) are eliminated
Proximity: if keywords in query occur close together in the document, the document has higher importance than if they occur far apart
Documents are returned in decreasing order of relevance score
Usually only top few documents are returned, not all
©Silberschatz, Korth and Sudarshan19.8Database System Concepts - 5th Edition, Sep 2, 2005
Similarity Based RetrievalSimilarity Based Retrieval
Similarity based retrieval - retrieve documents similar to a given document A
Similarity may be defined on the basis of common words
find k terms in a document A with highest values of TF (A, t ) / n (t )
use these k terms to find relevance of other documents.
Vector space model: define an n-dimensional space, where n is the number of words in the document set.
Vector for document d goes from origin to a point whose i th coordinate is r(d, t) = TF (d, t ) * IDF (t )
The cosine of the angle between the vectors of two documents is used as a measure of their similarity.
Relevance feedback: Similarity can be used to refine answer set to keyword query
User selects a few relevant documents from those retrieved by keyword query, and system finds other documents similar to these
©Silberschatz, Korth and Sudarshan19.9Database System Concepts - 5th Edition, Sep 2, 2005
Relevance using HyperlinksRelevance using Hyperlinks
If only term frequencies are taken into account
Number of documents relevant to a query can be enormous
Using high term frequencies makes “spamming” easy
– E.g. a travel agency can add many occurrences of the words “travel” to its page to make its rank very high
The advent of WWW
Observation: Most of the time people are looking for pages from popular sites
Idea: use popularity of Web site (e.g. how many people visit it) to rank site pages that match given keywords
Problem: hard to find actual popularity of site
Solution: next slide
©Silberschatz, Korth and Sudarshan19.10Database System Concepts - 5th Edition, Sep 2, 2005
Popularity RankingPopularity Ranking
Solution: use number of hyperlinks to a site as a measure of the popularity or prestige of the site
Count only one hyperlink from each site (why? - see previous slide)
Popularity measure is for site, not for individual page
But, most hyperlinks are to root of site
Also, concept of “site” difficult to define since a URL prefix like cs.yale.edu contains many unrelated pages of varying popularity
Refinements
When computing prestige based on links to a site, give more weight to links from sites that themselves have higher prestige
Definition is circular
Set up and solve system of simultaneous linear equations
Above idea is basis of the Google PageRank ranking mechanism
©Silberschatz, Korth and Sudarshan19.11Database System Concepts - 5th Edition, Sep 2, 2005
PageRankPageRank
PageRank
Invented by Brin and Page
The PageRank of a page PPii, denoted rr(PPii), is the sum of the PageRanks of all pages pointing into PPii
BBpi pi is the set of pages pointing into page PPii, |P|Pjj| | is the number of is the number of
outlinks from page Poutlinks from page Pjj
Iterative procedure to compute Iterative procedure to compute rr(P(Pii))
LetLet rrk+1k+1(PPii) be the PageRank of page PPi i at iteration k+1
r r ((PPjj))
|P|Pjj||PPjjBBpipi
==rr(P(Pii))
r r ((PPjj))|P|Pjj||PPjjBBpipi
==rrk+1 k+1 (P(Pii))
©Silberschatz, Korth and Sudarshan19.12Database System Concepts - 5th Edition, Sep 2, 2005
PageRank (cont.)PageRank (cont.)
1 2
3
56
4
Iteration 0 Iteration 1 Iteration 2 Rank at Iter. 2
r0(P1) = 1/6 r1(P1) = 1/18 r0(P1) = 1/36 5
r0(P2) = 1/6 r1(P2) = 5/36 r0(P2) = 1/18 4
r0(P3) = 1/6 r1(P3) = 1/12 r0(P3) = 1/36 5
r0(P4) = 1/6 r1(P4) = ¼ r0(P4) = 17/72 1
r0(P5) = 1/6 r1(P5) = 5/36 r0(P5) = 11/72 3
r0(P6) = 1/6 r1(P6) = 1/6 r0(P6) = 14/72 2
r r ((PPjj))|P|Pjj||PPjjBBpipi
==rrk+1 k+1 (P(Pii))
©Silberschatz, Korth and Sudarshan19.13Database System Concepts - 5th Edition, Sep 2, 2005
PageRank (cont.)PageRank (cont.)
The TF-IDF scores of a page are used to judge its relevance to the query keywords, and must be combined with the popularity ranking
PageRank is computed statically once, and reused for all queries
Drawback of the PageRank
It assigns a measure of popularity that does not take query keywords into account
Example)
Google.com is likely to have a very high PageRank because many sites contain a link to it
Google.com contain word “Stanford” (as of early 2005)
A search on the keyword “Stanford” would then return google.com at the highest ranked answer, ahead of the Stanford University Web page.
One of solutions
Use keywords in the anchor text of links to a page to judge what topics the page is highly relevant
< a href=http://stanford.edu> Stanford University </a>
©Silberschatz, Korth and Sudarshan19.14Database System Concepts - 5th Edition, Sep 2, 2005
HITS algorithmHITS algorithm
Connections to social networking theories that ranked prestige of people
E.g. the president of the U.S.A has a high prestige since many people know him
Someone known by multiple prestigious people has high prestige
The HITS algorithm (Hub and authority based ranking)
Find pages that contain the query keywords and then compute a popularity measure using just this set of related pages
A hub is a page that stores links to many pages (on a topic)
An authority is a page that contains actual information on a topic
Each page gets a hub prestige based on prestige of authorities that it points to
Each page gets an authority prestige based on prestige of hubs that point to it
Again, prestige definitions are cyclic, and can be got by solving linear equations
The HITS algorithm is susceptible to spamming
©Silberschatz, Korth and Sudarshan19.15Database System Concepts - 5th Edition, Sep 2, 2005
HITS ExampleHITS Example
3 10
61
5
2
Authority ranking = (6 3 5 1 2 10)Hub ranking = (1 3 6 10 2 5)
Advantage
Dual rankings
Hub ranking for broad search
Authority ranking for search deeply
Disadvantage
The HITS algorithm is susceptible to spamming
Adding outlinks
Adding links to and from the webpage
Create webpage containing links to good authorities on a topic
©Silberschatz, Korth and Sudarshan19.16Database System Concepts - 5th Edition, Sep 2, 2005
Synonyms and HomonymsSynonyms and Homonyms
Synonyms
E.g. document: “motorcycle repair”, query: “motorcycle maintenance”
need to realize that “maintenance” and “repair” are synonyms
System can extend query as “motorcycle and (repair or maintenance)”
Homonyms
E.g. “object” has different meanings as noun/verb
“table” could be a dinner table or a table in RDB
System can disambiguate meanings (to some extent) from the context
But, extending queries automatically using synonyms can be problematic
Need to understand intended meaning in order to infer synonyms
or verify synonyms with user
Synonyms may have other meanings as well
©Silberschatz, Korth and Sudarshan19.17Database System Concepts - 5th Edition, Sep 2, 2005
Concept-Based QueryingConcept-Based Querying
Approach
For each word, determine the concept it represents from context
Use one or more ontologies:
Hierarchical structure showing relationship between concepts
E.g.: the ISA relationship that we saw in the E-R model
This approach can be used to standardize terminology in a specific field
Gene Ontology
Ontology for home appliances
Ontologies can link multiple languages
WordNet for English
WordNet for Korean
Foundation of the Semantic Web (not covered here)
©Silberschatz, Korth and Sudarshan19.18Database System Concepts - 5th Edition, Sep 2, 2005
Indexing of DocumentsIndexing of Documents
An inverted index maps each keyword Ki to a set of documents Si that contain the keyword Documents identified by identifiers
Inverted index may record Keyword locations within document to allow proximity based ranking Counts of number of occurrences of keyword to compute TF
“and” operation Finds documents that contain all of K1, K2, ..., Kn.
Intersection S1 S2 ..... Sn
“or” operation Finds documents that contain at least one of K1, K2, …, Kn
union, S1U S2 U..... U Sn,.
Each Si is kept sorted to allow efficient intersection/union by merging
“not” can also be efficiently implemented by merging of sorted lists
©Silberschatz, Korth and Sudarshan19.19Database System Concepts - 5th Edition, Sep 2, 2005
Inverted IndexInverted Index Index construction
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 1
So let it be withCaesar. The nobleBrutus hath told youCaesar was ambitious
Doc 2
Term 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 2
Term 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 2
Sorted by terms
Term Doc #ambitious 2be 2brutus 1,2capitol 1caesar 1,2did 1enact 1hath 1I 1i' 1it 2julius 1killed 1,2let 2me 1noble 2so 2the 1,2told 2you 2was 1,2with 2
©Silberschatz, Korth and Sudarshan19.20Database System Concepts - 5th Edition, Sep 2, 2005
Measuring Retrieval EffectivenessMeasuring Retrieval Effectiveness
Information-retrieval systems save storage space by using index structures that support only approximate retrieval.
May result in:
false negative (false drop) - some relevant documents may not be retrieved.
false positive - some irrelevant documents may be retrieved.
For many applications a good index should not permit any false drops, but may permit a few false positives.
Relevant performance metrics
Precision
what percentage of the retrieved documents are relevant to the query = C / A
Recall
what percentage of the documents relevant to the query were retrieved = C / B
Document poolB: Relevant documents
A: Retrieved documentsC
©Silberschatz, Korth and Sudarshan19.21Database System Concepts - 5th Edition, Sep 2, 2005
Measuring Retrieval Effectiveness (Cont.)Measuring Retrieval Effectiveness (Cont.)
The tradeoff in Recall vs. Precision:
Retrieving many documents (down to a low level of relevance ranking) can increase recall, but many irrelevant documents would reduce precision
Better measure of retrieval effectiveness:
Recall as a function of number of documents fetched, or
Precision as a function of recall
Equivalently, as a function of number of documents fetched
E.g. “precision of 75% at recall of 50%, & precision 60% at a recall of 75%”
Problem: which documents are actually relevant, and which are not!
©Silberschatz, Korth and Sudarshan19.22Database System Concepts - 5th Edition, Sep 2, 2005
Web Search Engine ArchitectureWeb Search Engine Architecture
NAVER: more than 3000 servers
Google: more than 20,000 servers
The Web
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 crawlers
Search
User
Indexer
Query engine
Inverted indexes
©Silberschatz, Korth and Sudarshan19.23Database System Concepts - 5th Edition, Sep 2, 2005
Web Search EnginesWeb Search Engines
Web crawlers are programs that locate and gather information on the Web
Recursively follow hyperlinks present in known documents, to find other documents
Starting from a seed set of documents
Fetched documents
Handed over to an indexing system
Can be discarded after indexing, or store as a cached copy
Crawling the entire Web would take a very large amount of time
Search engines typically cover only a part of the Web, not all of it
Take months to perform a single crawl
©Silberschatz, Korth and Sudarshan19.24Database System Concepts - 5th Edition, Sep 2, 2005
Web Search EnginesWeb Search Engines (Cont.)(Cont.)
Crawling is done by multiple processes on multiple machines, running in parallel
Set of links to be crawled are stored in a database
New links found in crawled pages are added to this set, to be crawled later
Indexing process also runs on multiple machines
Creates a new copy of index instead of modifying old index
Old index is used to answer queries
After a crawl is “completed” new index becomes “old” index
Multiple machines used to answer queries
Indices may be kept in memory
Queries may be routed to different machines for load balancing
25
End of ChapterEnd of Chapter