SlideShare a Scribd company logo
In association with and
Chapter 4
Processing Text
Search Engines and Information Retrieval
Full Credit: Croft et al. - http://www.search-engines-book.com/
In association with and
From Ch. 2: Indexing Process
In association with and
Processing Text
● Converting documents to index terms
● Why?
○ Matching the exact string of characters typed by the user is too restrictive
■ i.e., it doesn’t work very well in terms of effectiveness
■ e.g. uppercase/lowercase
○ Not all words are of equal value in a search
○ Sometimes not clear where words begin and end
■ Not even clear what a word is in some languages
● e.g., Chinese, Korean
In association with and
Text Statistics
● Huge variety of words used in text but
● Many statistical characteristics of word occurrences are predictable
○ e.g., distribution of word counts
● Retrieval models and ranking algorithms depend heavily on statistical
properties of words
○ e.g., important words occur often in documents but are not high frequency in collection
Retrieval models are algorithms or frameworks used in information retrieval systems to match user queries with relevant
documents from a collection of documents, such as web pages, articles, or books.
In association with and
Zipf’s Law
● Distribution of word frequencies is very skewed
○ a few words occur very often, many words hardly ever occur
○ e.g., two most common words (“the”, “of”) make up about 10% of all word occurrences in
text documents
● Zipf’s “law”:
○ observation that rank (r) of a word times its frequency (f) is approximately a constant (k)
■ assuming words are ranked in order of decreasing frequency
○ i.e., r.f ≈ k or r.Pr
≈ c, where Pr
is probability of word occurrence and c ≈ 0.1 for English
In association with and
Zipf’s Law
In association with and
News Collection (AP89) Statistics
Total documents 84,678
Total word occurrences 39,749,179
Vocabulary size 198,763
Words occurring > 1000 times 4,169
Words occurring once 70,064
Word Freq. r Pr(%) r.Pr
Assistant 5,095 1,021 .013 0.13
Sewers 100 17,110 2.56 × 10−4 0.04
Toothbrush 10 51,555 2.56 × 10−5 0.01
Hazmat 1 166,945 2.56 × 10−6 0.04
In association with and
Top 50 Words from AP89
In association with and
Zipf’s Law for AP89
Note problems at high and low frequencies
(Log Scale)
P
r
(Log
Scale)
In association with and
Zipf’s Law
● What is the proportion of words with a given frequency?
○ Word that occurs n times has rank rn = k/n
○ Number of words with frequency n is (estimate)
■ rn
− rn+1
= k/n − k/(n + 1) = k/n(n + 1)
○ Proportion found by dividing by total number of words = highest rank = k
○ So, proportion with frequency n is 1/n(n+1)
○ Proportion of words with freq n = number of distinct words with freq n / total number of
unique words = k/n(n+1) / k = 1/n(n+1)
In association with and
Zipf’s Law
● Example word frequency ranking
● To compute number of words with frequency 5,099
○ rank of “chemical” minus the rank of “summit”
○ 1006 − 1002 = 4
In association with and
Example
● Proportions of words occurring n times in 336,310 TREC documents
● Vocabulary size is 508,209
In association with and
Vocabulary Growth
● As corpus grows, so does vocabulary size
○ Fewer new words when corpus is already large
● Observed relationship (Heaps’ Law)
v = k.nβ
○ where
■ v is vocabulary size (number of unique words),
■ n is the number of words in corpus (number of total words),
■ k, β are parameters that vary for each corpus
■ (typical values given are 10 ≤ k ≤ 100 and β ≈ 0.5)
In association with and
AP89 Example
In association with and
Heaps’ Law Predictions
● Predictions for TREC collections are accurate for large numbers of words
○ e.g., first 10,879,522 words of the AP89 collection scanned
○ prediction is 100,151 unique words
○ actual number is 100,024
● Predictions for small numbers of words (i.e. < 1000) are much worse
In association with and
GOV2 (Web) Example
In association with and
Web Example
● Heaps’ Law works with very large corpora
○ new words occurring even after seeing 30 million!
○ parameter values different than typical TREC values
● New words come from a variety of sources
■ spelling errors, invented words (e.g. product, company names), code, other
languages, email addresses, etc.
● Search engines must deal with these large and growing vocabularies
In association with and
Estimating Result Set Size
● How many pages contain all of the query terms?
● For the query [a b c]:
○ fabc
= N · fa
/N · fb
/N · fc
/N = (fa
· fb
· fc
)/N2
■ Assuming that terms occur independently
■ fabc
is the estimated size of the result set
■ fa
, fb
, fc
are the number of documents that terms a, b, and c occur in
■ N is the number of documents in the collection
In association with and
GOV2 Example
Collection size (N) is 25,205,179
Observed
In association with and
Result Set Size Estimation
● Poor estimates because words are not independent
● Better estimates possible if co-occurrence information available
○ P(a ∩ b ∩ c) = P(a ∩ b) · P(c|(a ∩ b))
○ ftropical∩fish∩aquarium
= ftropical∩aquarium
· ffish∩aquarium
/faquarium
■ = 1921 · 9722/26480 = 705
○ ftropical∩fish∩breeding
= ftropical∩breeding
· ffish∩breeeding
/fbreeding
■ = 5510 · 36427/81885 = 2451
In association with and
Result Set Estimation
● Even better estimates using initial result set
○ Estimate is simply C/s
■ where s is the proportion of the total documents that have been ranked, and C is the
number of documents found that contain all the query words
○ E.g., “tropical fish aquarium” in GOV2
■ after processing 3,000 out of the 26,480 documents that contain “aquarium”, C = 258
● ftropical∩fish∩aquarium
= 258/(3000÷26480) = 2,277
■ After processing 20% of the documents,
● ftropical∩fish∩aquarium
= 1,778 (1,529 is real value)
In association with and
Estimating Collection Size
● Important issue for Web search engines
● Simple technique: use independence model
○ Given two words a and b that are independent
○ fab
/N = fa
/N · fb
/N
○ N = (fa
· fb
)/fab
○ e.g., for GOV2
■ flincoln
= 771,326 ftropical
= 120,990 flincoln ∩ tropical
= 3,018
■ N = (120990 · 771326)/3018 = 30,922,045
■ (actual number is 25,205,179)
In association with and
See you next time
Image Credit: Adobe Text to Image
In association with and
Tokenizing
● Forming words from sequence of characters
● Surprisingly complex in English, can be harder in other languages
● Early IR systems:
○ any sequence of alphanumeric characters of length 3 or more
○ terminated by a space or other special character
○ upper-case changed to lower-case
In association with and
Tokenizing
● Example:
○ “Bigcorp's 2007 bi-annual report showed profits rose 10%.” becomes
○ “bigcorp 2007 annual report showed profits rose”
● Too simple for search applications or even large-scale experiments
● Why? Too much information lost
○ Small decisions in tokenizing can have major impact on effectiveness of some queries
In association with and
Tokenizing Problems
● Small words can be important in some queries, usually in combinations
■ xp, ma, pm, ben e king, el paso, master p, gm, j lo, world war II
● Both hyphenated and non-hyphenated forms of many words are common
○ Sometimes hyphen is not needed
■ e-bay, wal-mart, active-x, cd-rom, t-shirts
○ At other times, hyphens should be considered either as part of the word or a word
separator
■ winston-salem, mazda rx-7, e-cards, pre-diabetes, t-mobile, spanish-speaking
In association with and
Tokenizing Problems
● Special characters are an important part of tags, URLs, code in documents
● Capitalized words can have different meaning from lower case words
○ Bush, Apple
● Apostrophes can be a part of a word, a part of a possessive, or just a
mistake
○ rosie o'donnell, can't, don't, 80's, 1890's, men's straw hats, master's degree, england's ten
largest cities, shriner's
In association with and
Tokenizing Problems
● Numbers can be important, including decimals
○ nokia 3250, top 10 courses, united 93, quicktime 6.5 pro, 92.3 the beat, 288358
● Periods can occur in numbers, abbreviations, URLs, ends of sentences,
and other situations
○ I.B.M., Ph.D., cs.umass.edu, F.E.A.R.
● Note: tokenizing steps for queries must be identical to steps for documents
In association with and
Tokenizing Process
● First step is to use parser to identify appropriate parts of document to
tokenize
● Defer complex decisions to other components
○ word is any sequence of alphanumeric characters, terminated by a space or special
character, with everything converted to lower-case
○ everything indexed
○ example: 92.3 → 92 3 but search finds documents with 92 and 3 adjacent
○ incorporate some rules to reduce dependence on query transformation components
In association with and
Tokenizing Process
● Not that different than simple tokenizing process used in past
● Examples of rules used with TREC
○ Apostrophes in words ignored
■ o’connor → oconnor bob’s → bobs
○ Periods in abbreviations ignored
■ I.B.M. → ibm Ph.D. → ph d
In association with and
Stopping
● Function words (determiners, prepositions) have little meaning on their
own
● High occurrence frequencies
● Treated as stopwords (i.e. removed)
○ reduce index space, improve response time, improve effectiveness
● Can be important in combinations
○ e.g., “to be or not to be”
In association with and
Stopping
● Stopword list can be created from high-frequency words or based on a
standard list
● Lists are customized for applications, domains, and even parts of
documents
○ e.g., “click” is a good stopword for anchor text
● Best policy is to index all words in documents, make decisions about which
words to use at query time
In association with and
Stemming
● Many morphological variations of words
○ inflectional (plurals, tenses)
○ derivational (making verbs nouns etc.)
● In most cases, these have the same or very similar meanings
● Stemmers attempt to reduce morphological variations of words to a
common stem
○ usually involves removing suffixes
● Can be done at indexing time or as part of query processing (like
stopwords)
In association with and
Stemming
● Generally a small but significant effectiveness improvement
○ can be crucial for some languages
○ e.g., 5-10% improvement for English, up to 50% in Arabic
Words with the Arabic root ktb
In association with and
Stemming
● Two basic types
○ Dictionary-based: uses lists of related words
○ Algorithmic: uses program to determine related words
● Algorithmic stemmers
○ suffix-s: remove ‘s’ endings assuming plural
■ e.g., cats → cat, lakes → lake, wiis → wii
■ Many false negatives: supplies → supplie
■ Some false positives: ups → up
In association with and
Porter Stemmer
● Algorithmic stemmer used in IR experiments since the 70s
● Consists of a series of rules designed to the longest possible suffix at each
step
● Effective in TREC
● Produces stems not words
● Makes a number of errors and difficult to modify
vvi
In association with and
Porter Stemmer
● Example step (1 of 5)
In association with and
Porter Stemmer
● Porter2 stemmer addresses some of these issues
● Approach has been used with other languages
In association with and
Krovetz Stemmer
● Hybrid algorithmic-dictionary
○ Word checked in dictionary
■ If present, either left alone or replaced with “exception”
■ If not present, word is checked for suffixes that could be removed
■ After removal, dictionary is checked again
● Produces words not stems
● Comparable effectiveness
● Lower false positive rate, somewhat higher false negative
In association with and
Stemmer Comparison
In association with and
Phrases
● Many queries are 2-3 word phrases
● Phrases are
○ More precise than single words
■ e.g., documents containing “computer science” vs. two words “science” and “computer”
○ Less ambiguous
■ e.g., “big apple” vs. “apple”
● Can be difficult for ranking
■ e.g., Given query “fishing supplies”, how do we score documents with
● exact phrase many times, exact phrase just once, individual words in same sentence,
same paragraph, whole document, variations on words?
In association with and
Phrases
● Text processing issue – how are phrases recognized?
● Three possible approaches:
○ Identify syntactic phrases using a part-of-speech (POS) tagger
○ Use word n-grams
○ Store word positions in indexes and use proximity operators in queries
In association with and
POS Tagging
● POS taggers use statistical models of text to predict syntactic tags of
words
○ Example tags:
■ NN (singular noun), NNS (plural noun), VB (verb), VBD (verb, past tense), VBN
(verb, past participle), IN (preposition), JJ (adjective), CC (conjunction, e.g., “and”,
“or”), PRP (pronoun), and MD (modal auxiliary, e.g., “can”, “will”).
● Phrases can then be defined as simple noun groups, for example
In association with and
Pos Tagging Example
In association with and
Example Noun Phrases
In association with and
Word N-Grams
● POS tagging too slow for large collections
● Simpler definition – phrase is any sequence of n words – known as
n-grams
○ bigram: 2 word sequence, trigram: 3 word sequence, unigram: single words
○ N-grams also used at character level for applications such as OCR
● N-grams typically formed from overlapping sequences of words
○ i.e. move n-word “window” one word at a time in document
In association with and
N-Grams
● Frequent n-grams are more likely to be meaningful phrases
● N-grams form a Zipf distribution
○ Better fit than words alone
● Could index all n-grams up to specified length
○ Much faster than POS tagging
○ Uses a lot of storage
■ e.g., document containing 1,000 words would contain 3,990 instances of word
n-grams of length 2 ≤ n ≤ 5
In association with and
Document Structure and Markup
● Some parts of documents are more important than others
● Document parser recognizes structure using markup, such as HTML tags
○ Headers, anchor text, bolded text all likely to be important
○ Metadata can also be important
○ Links used for link analysis
In association with and
Example Web Page
In association with and
Example Web Page
In association with and
See you next time
Image Credit: Adobe Text to Image
In association with and
Link Analysis
● Links are a key component of the Web
● Important for navigation, but also for search
○ e.g., <a href="http://example.com" >Example website</a>
○ “Example website” is the anchor text
○ “http://example.com” is the destination link
○ both are used by search engines
In association with and
Anchor Text
● Used as a description of the content of the destination page
○ i.e., collection of anchor text in all links pointing to a page used as an additional text field
● Anchor text tends to be short, descriptive, and similar to query text
● Retrieval experiments have shown that anchor text has significant impact
on effectiveness for some types of queries
○ i.e., more than PageRank
○ anchor text indicates topic of the page, PageRank is topic-independent popularity of a
page
In association with and
Anchor Text
● Can lead to Google Bombing: anyone can call you something bad
In association with and
PageRank
● Billions of web pages, some more informative than others
● Links can be viewed as information about the popularity (authority?) of a
web page
○ can be used by ranking algorithm
● Inlink count could be used as simple measure
● Link analysis algorithms like PageRank provide more reliable ratings
○ less susceptible to link spam
In association with and
Random Surfer Model
● Browse the Web using the following algorithm:
○ Choose a random number r between 0 and 1: λ
○ With probability λ, the web surfer goes to a random page on the web (type a new URL in their browser)
○ With probability (1-λ) he/she clicks on one of the outlinks from the page
○ If r < λ:
■ Go to a random page
○ If r ≥ λ:
■ Click a link at random on the current page
○ Start again
● PageRank of a page is the probability that the “random surfer” will be looking at that page
○ links from popular pages will increase PageRank of pages they point to
In association with and
Dangling Links
● Random jump prevents getting stuck on pages that
○ do not have links
○ contains only links that no longer point to other pages
○ have links forming a loop
● Links that point to the first two types of pages are called dangling
links
○ may also be links to pages that have not yet been crawled
In association with and
PageRank
● PageRank (PR) of page C = PR(A)/2 + PR(B)/1
● More generally,
○ where Bu
is the set of pages that point to u, and Lv
is the number of outgoing links from page v
(not counting duplicate links)
In association with and
PageRank
● Don’t know PageRank values at start
● Assume equal values (1/3 in this case), then iterate:
○ first iteration: PR(C) = 0.33/2 + 0.33 = 0.5, PR(A) = 0.33, and PR(B) = 0.17
○ second: PR(C) = 0.33/2 + 0.17 = 0.33, PR(A) = 0.5, PR(B) = 0.17
○ third: PR(C) = 0.42, PR(A) = 0.33, PR(B) = 0.25
● Converges to PR(C) = 0.4, PR(A) = 0.4, and PR(B) = 0.2
In association with and
PageRank
● Taking random page jump into account, 1/3 chance of going to any page
when r < λ
● PR(C) = λ/3 + (1 − λ) · (PR(A)/2 + PR(B)/1)
● More generally,
○ where N is the number of pages in the corpus (web), λ typically 0.15
In association with and
In association with and
Link Quality
● Pagerank was designed for when humans thoughtfully linked to other pages
● Link quality is affected by spam and other factors
○ e.g., link farms to increase PageRank
○ trackback links in blogs can create loops
○ links from comments section of popular blogs
■ Blog services modify comment links to contain rel=nofollow attribute
■ e.g., “Come visit my <a rel=nofollow href="http://www.page.com">web page</a>.”
In association with and
Trackback Links
ii

More Related Content

PPTX
Info 2402 irt-chapter_4
PPTX
Lecture 7- Text Statistics and Document Parsing
PDF
Chapter 2: Text Operation in information stroage and retrieval
PDF
Chapter 2 Text Operation.pdf
PDF
Chapter 2 Text Operation and Term Weighting.pdf
PPT
IR CHAPTER_TWO Most important for students
PPT
CHapter 2_text operation.ppt material for university students
PDF
Shilpa shukla processing_text
Info 2402 irt-chapter_4
Lecture 7- Text Statistics and Document Parsing
Chapter 2: Text Operation in information stroage and retrieval
Chapter 2 Text Operation.pdf
Chapter 2 Text Operation and Term Weighting.pdf
IR CHAPTER_TWO Most important for students
CHapter 2_text operation.ppt material for university students
Shilpa shukla processing_text

Similar to information retrival and text processing (20)

PDF
Information storage and Retrieval-Chapter 2 Updated.pdf
PPT
2_text operationinformation retrieval. ppt
PDF
Information retrieval concept, practice and challenge
PPTX
Taxonomies in Search
PPT
Information retrieval chapter 2-Text Operations.ppt
PPTX
Information storage and retrieval system unit two
PPT
2_text operatinnjjjjkkkkkkkkkkkkgggggggggggggggggggon.ppt
PPTX
Retrieval approches
PPT
Information Retrieval
PPTX
Chapter05
PPTX
01 IRS-1 (1) document upload the link to
PPTX
01 IRS to upload the data according to the.pptx
PPTX
PDF
ICDIM 06 Web IR Tutorial [Compatibility Mode].pdf
PPT
3_Indexing.ppt
PDF
14. Michael Oakes (UoW) Natural Language Processing for Translation
PPS
Google Search Presentation
PDF
A Simple Information Retrieval Technique
PDF
Concepts and Challenges of Text Retrieval for Search Engine
Information storage and Retrieval-Chapter 2 Updated.pdf
2_text operationinformation retrieval. ppt
Information retrieval concept, practice and challenge
Taxonomies in Search
Information retrieval chapter 2-Text Operations.ppt
Information storage and retrieval system unit two
2_text operatinnjjjjkkkkkkkkkkkkgggggggggggggggggggon.ppt
Retrieval approches
Information Retrieval
Chapter05
01 IRS-1 (1) document upload the link to
01 IRS to upload the data according to the.pptx
ICDIM 06 Web IR Tutorial [Compatibility Mode].pdf
3_Indexing.ppt
14. Michael Oakes (UoW) Natural Language Processing for Translation
Google Search Presentation
A Simple Information Retrieval Technique
Concepts and Challenges of Text Retrieval for Search Engine
Ad

Recently uploaded (20)

PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
RMMM.pdf make it easy to upload and study
PPTX
Cell Structure & Organelles in detailed.
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
01-Introduction-to-Information-Management.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Lesson notes of climatology university.
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Institutional Correction lecture only . . .
PDF
Insiders guide to clinical Medicine.pdf
PDF
Basic Mud Logging Guide for educational purpose
PPH.pptx obstetrics and gynecology in nursing
VCE English Exam - Section C Student Revision Booklet
RMMM.pdf make it easy to upload and study
Cell Structure & Organelles in detailed.
TR - Agricultural Crops Production NC III.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
O5-L3 Freight Transport Ops (International) V1.pdf
Supply Chain Operations Speaking Notes -ICLT Program
01-Introduction-to-Information-Management.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Computing-Curriculum for Schools in Ghana
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Lesson notes of climatology university.
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Institutional Correction lecture only . . .
Insiders guide to clinical Medicine.pdf
Basic Mud Logging Guide for educational purpose
Ad

information retrival and text processing

  • 1. In association with and Chapter 4 Processing Text Search Engines and Information Retrieval Full Credit: Croft et al. - http://www.search-engines-book.com/
  • 2. In association with and From Ch. 2: Indexing Process
  • 3. In association with and Processing Text ● Converting documents to index terms ● Why? ○ Matching the exact string of characters typed by the user is too restrictive ■ i.e., it doesn’t work very well in terms of effectiveness ■ e.g. uppercase/lowercase ○ Not all words are of equal value in a search ○ Sometimes not clear where words begin and end ■ Not even clear what a word is in some languages ● e.g., Chinese, Korean
  • 4. In association with and Text Statistics ● Huge variety of words used in text but ● Many statistical characteristics of word occurrences are predictable ○ e.g., distribution of word counts ● Retrieval models and ranking algorithms depend heavily on statistical properties of words ○ e.g., important words occur often in documents but are not high frequency in collection Retrieval models are algorithms or frameworks used in information retrieval systems to match user queries with relevant documents from a collection of documents, such as web pages, articles, or books.
  • 5. In association with and Zipf’s Law ● Distribution of word frequencies is very skewed ○ a few words occur very often, many words hardly ever occur ○ e.g., two most common words (“the”, “of”) make up about 10% of all word occurrences in text documents ● Zipf’s “law”: ○ observation that rank (r) of a word times its frequency (f) is approximately a constant (k) ■ assuming words are ranked in order of decreasing frequency ○ i.e., r.f ≈ k or r.Pr ≈ c, where Pr is probability of word occurrence and c ≈ 0.1 for English
  • 6. In association with and Zipf’s Law
  • 7. In association with and News Collection (AP89) Statistics Total documents 84,678 Total word occurrences 39,749,179 Vocabulary size 198,763 Words occurring > 1000 times 4,169 Words occurring once 70,064 Word Freq. r Pr(%) r.Pr Assistant 5,095 1,021 .013 0.13 Sewers 100 17,110 2.56 × 10−4 0.04 Toothbrush 10 51,555 2.56 × 10−5 0.01 Hazmat 1 166,945 2.56 × 10−6 0.04
  • 8. In association with and Top 50 Words from AP89
  • 9. In association with and Zipf’s Law for AP89 Note problems at high and low frequencies (Log Scale) P r (Log Scale)
  • 10. In association with and Zipf’s Law ● What is the proportion of words with a given frequency? ○ Word that occurs n times has rank rn = k/n ○ Number of words with frequency n is (estimate) ■ rn − rn+1 = k/n − k/(n + 1) = k/n(n + 1) ○ Proportion found by dividing by total number of words = highest rank = k ○ So, proportion with frequency n is 1/n(n+1) ○ Proportion of words with freq n = number of distinct words with freq n / total number of unique words = k/n(n+1) / k = 1/n(n+1)
  • 11. In association with and Zipf’s Law ● Example word frequency ranking ● To compute number of words with frequency 5,099 ○ rank of “chemical” minus the rank of “summit” ○ 1006 − 1002 = 4
  • 12. In association with and Example ● Proportions of words occurring n times in 336,310 TREC documents ● Vocabulary size is 508,209
  • 13. In association with and Vocabulary Growth ● As corpus grows, so does vocabulary size ○ Fewer new words when corpus is already large ● Observed relationship (Heaps’ Law) v = k.nβ ○ where ■ v is vocabulary size (number of unique words), ■ n is the number of words in corpus (number of total words), ■ k, β are parameters that vary for each corpus ■ (typical values given are 10 ≤ k ≤ 100 and β ≈ 0.5)
  • 14. In association with and AP89 Example
  • 15. In association with and Heaps’ Law Predictions ● Predictions for TREC collections are accurate for large numbers of words ○ e.g., first 10,879,522 words of the AP89 collection scanned ○ prediction is 100,151 unique words ○ actual number is 100,024 ● Predictions for small numbers of words (i.e. < 1000) are much worse
  • 16. In association with and GOV2 (Web) Example
  • 17. In association with and Web Example ● Heaps’ Law works with very large corpora ○ new words occurring even after seeing 30 million! ○ parameter values different than typical TREC values ● New words come from a variety of sources ■ spelling errors, invented words (e.g. product, company names), code, other languages, email addresses, etc. ● Search engines must deal with these large and growing vocabularies
  • 18. In association with and Estimating Result Set Size ● How many pages contain all of the query terms? ● For the query [a b c]: ○ fabc = N · fa /N · fb /N · fc /N = (fa · fb · fc )/N2 ■ Assuming that terms occur independently ■ fabc is the estimated size of the result set ■ fa , fb , fc are the number of documents that terms a, b, and c occur in ■ N is the number of documents in the collection
  • 19. In association with and GOV2 Example Collection size (N) is 25,205,179 Observed
  • 20. In association with and Result Set Size Estimation ● Poor estimates because words are not independent ● Better estimates possible if co-occurrence information available ○ P(a ∩ b ∩ c) = P(a ∩ b) · P(c|(a ∩ b)) ○ ftropical∩fish∩aquarium = ftropical∩aquarium · ffish∩aquarium /faquarium ■ = 1921 · 9722/26480 = 705 ○ ftropical∩fish∩breeding = ftropical∩breeding · ffish∩breeeding /fbreeding ■ = 5510 · 36427/81885 = 2451
  • 21. In association with and Result Set Estimation ● Even better estimates using initial result set ○ Estimate is simply C/s ■ where s is the proportion of the total documents that have been ranked, and C is the number of documents found that contain all the query words ○ E.g., “tropical fish aquarium” in GOV2 ■ after processing 3,000 out of the 26,480 documents that contain “aquarium”, C = 258 ● ftropical∩fish∩aquarium = 258/(3000÷26480) = 2,277 ■ After processing 20% of the documents, ● ftropical∩fish∩aquarium = 1,778 (1,529 is real value)
  • 22. In association with and Estimating Collection Size ● Important issue for Web search engines ● Simple technique: use independence model ○ Given two words a and b that are independent ○ fab /N = fa /N · fb /N ○ N = (fa · fb )/fab ○ e.g., for GOV2 ■ flincoln = 771,326 ftropical = 120,990 flincoln ∩ tropical = 3,018 ■ N = (120990 · 771326)/3018 = 30,922,045 ■ (actual number is 25,205,179)
  • 23. In association with and See you next time Image Credit: Adobe Text to Image
  • 24. In association with and Tokenizing ● Forming words from sequence of characters ● Surprisingly complex in English, can be harder in other languages ● Early IR systems: ○ any sequence of alphanumeric characters of length 3 or more ○ terminated by a space or other special character ○ upper-case changed to lower-case
  • 25. In association with and Tokenizing ● Example: ○ “Bigcorp's 2007 bi-annual report showed profits rose 10%.” becomes ○ “bigcorp 2007 annual report showed profits rose” ● Too simple for search applications or even large-scale experiments ● Why? Too much information lost ○ Small decisions in tokenizing can have major impact on effectiveness of some queries
  • 26. In association with and Tokenizing Problems ● Small words can be important in some queries, usually in combinations ■ xp, ma, pm, ben e king, el paso, master p, gm, j lo, world war II ● Both hyphenated and non-hyphenated forms of many words are common ○ Sometimes hyphen is not needed ■ e-bay, wal-mart, active-x, cd-rom, t-shirts ○ At other times, hyphens should be considered either as part of the word or a word separator ■ winston-salem, mazda rx-7, e-cards, pre-diabetes, t-mobile, spanish-speaking
  • 27. In association with and Tokenizing Problems ● Special characters are an important part of tags, URLs, code in documents ● Capitalized words can have different meaning from lower case words ○ Bush, Apple ● Apostrophes can be a part of a word, a part of a possessive, or just a mistake ○ rosie o'donnell, can't, don't, 80's, 1890's, men's straw hats, master's degree, england's ten largest cities, shriner's
  • 28. In association with and Tokenizing Problems ● Numbers can be important, including decimals ○ nokia 3250, top 10 courses, united 93, quicktime 6.5 pro, 92.3 the beat, 288358 ● Periods can occur in numbers, abbreviations, URLs, ends of sentences, and other situations ○ I.B.M., Ph.D., cs.umass.edu, F.E.A.R. ● Note: tokenizing steps for queries must be identical to steps for documents
  • 29. In association with and Tokenizing Process ● First step is to use parser to identify appropriate parts of document to tokenize ● Defer complex decisions to other components ○ word is any sequence of alphanumeric characters, terminated by a space or special character, with everything converted to lower-case ○ everything indexed ○ example: 92.3 → 92 3 but search finds documents with 92 and 3 adjacent ○ incorporate some rules to reduce dependence on query transformation components
  • 30. In association with and Tokenizing Process ● Not that different than simple tokenizing process used in past ● Examples of rules used with TREC ○ Apostrophes in words ignored ■ o’connor → oconnor bob’s → bobs ○ Periods in abbreviations ignored ■ I.B.M. → ibm Ph.D. → ph d
  • 31. In association with and Stopping ● Function words (determiners, prepositions) have little meaning on their own ● High occurrence frequencies ● Treated as stopwords (i.e. removed) ○ reduce index space, improve response time, improve effectiveness ● Can be important in combinations ○ e.g., “to be or not to be”
  • 32. In association with and Stopping ● Stopword list can be created from high-frequency words or based on a standard list ● Lists are customized for applications, domains, and even parts of documents ○ e.g., “click” is a good stopword for anchor text ● Best policy is to index all words in documents, make decisions about which words to use at query time
  • 33. In association with and Stemming ● Many morphological variations of words ○ inflectional (plurals, tenses) ○ derivational (making verbs nouns etc.) ● In most cases, these have the same or very similar meanings ● Stemmers attempt to reduce morphological variations of words to a common stem ○ usually involves removing suffixes ● Can be done at indexing time or as part of query processing (like stopwords)
  • 34. In association with and Stemming ● Generally a small but significant effectiveness improvement ○ can be crucial for some languages ○ e.g., 5-10% improvement for English, up to 50% in Arabic Words with the Arabic root ktb
  • 35. In association with and Stemming ● Two basic types ○ Dictionary-based: uses lists of related words ○ Algorithmic: uses program to determine related words ● Algorithmic stemmers ○ suffix-s: remove ‘s’ endings assuming plural ■ e.g., cats → cat, lakes → lake, wiis → wii ■ Many false negatives: supplies → supplie ■ Some false positives: ups → up
  • 36. In association with and Porter Stemmer ● Algorithmic stemmer used in IR experiments since the 70s ● Consists of a series of rules designed to the longest possible suffix at each step ● Effective in TREC ● Produces stems not words ● Makes a number of errors and difficult to modify vvi
  • 37. In association with and Porter Stemmer ● Example step (1 of 5)
  • 38. In association with and Porter Stemmer ● Porter2 stemmer addresses some of these issues ● Approach has been used with other languages
  • 39. In association with and Krovetz Stemmer ● Hybrid algorithmic-dictionary ○ Word checked in dictionary ■ If present, either left alone or replaced with “exception” ■ If not present, word is checked for suffixes that could be removed ■ After removal, dictionary is checked again ● Produces words not stems ● Comparable effectiveness ● Lower false positive rate, somewhat higher false negative
  • 40. In association with and Stemmer Comparison
  • 41. In association with and Phrases ● Many queries are 2-3 word phrases ● Phrases are ○ More precise than single words ■ e.g., documents containing “computer science” vs. two words “science” and “computer” ○ Less ambiguous ■ e.g., “big apple” vs. “apple” ● Can be difficult for ranking ■ e.g., Given query “fishing supplies”, how do we score documents with ● exact phrase many times, exact phrase just once, individual words in same sentence, same paragraph, whole document, variations on words?
  • 42. In association with and Phrases ● Text processing issue – how are phrases recognized? ● Three possible approaches: ○ Identify syntactic phrases using a part-of-speech (POS) tagger ○ Use word n-grams ○ Store word positions in indexes and use proximity operators in queries
  • 43. In association with and POS Tagging ● POS taggers use statistical models of text to predict syntactic tags of words ○ Example tags: ■ NN (singular noun), NNS (plural noun), VB (verb), VBD (verb, past tense), VBN (verb, past participle), IN (preposition), JJ (adjective), CC (conjunction, e.g., “and”, “or”), PRP (pronoun), and MD (modal auxiliary, e.g., “can”, “will”). ● Phrases can then be defined as simple noun groups, for example
  • 44. In association with and Pos Tagging Example
  • 45. In association with and Example Noun Phrases
  • 46. In association with and Word N-Grams ● POS tagging too slow for large collections ● Simpler definition – phrase is any sequence of n words – known as n-grams ○ bigram: 2 word sequence, trigram: 3 word sequence, unigram: single words ○ N-grams also used at character level for applications such as OCR ● N-grams typically formed from overlapping sequences of words ○ i.e. move n-word “window” one word at a time in document
  • 47. In association with and N-Grams ● Frequent n-grams are more likely to be meaningful phrases ● N-grams form a Zipf distribution ○ Better fit than words alone ● Could index all n-grams up to specified length ○ Much faster than POS tagging ○ Uses a lot of storage ■ e.g., document containing 1,000 words would contain 3,990 instances of word n-grams of length 2 ≤ n ≤ 5
  • 48. In association with and Document Structure and Markup ● Some parts of documents are more important than others ● Document parser recognizes structure using markup, such as HTML tags ○ Headers, anchor text, bolded text all likely to be important ○ Metadata can also be important ○ Links used for link analysis
  • 49. In association with and Example Web Page
  • 50. In association with and Example Web Page
  • 51. In association with and See you next time Image Credit: Adobe Text to Image
  • 52. In association with and Link Analysis ● Links are a key component of the Web ● Important for navigation, but also for search ○ e.g., <a href="http://example.com" >Example website</a> ○ “Example website” is the anchor text ○ “http://example.com” is the destination link ○ both are used by search engines
  • 53. In association with and Anchor Text ● Used as a description of the content of the destination page ○ i.e., collection of anchor text in all links pointing to a page used as an additional text field ● Anchor text tends to be short, descriptive, and similar to query text ● Retrieval experiments have shown that anchor text has significant impact on effectiveness for some types of queries ○ i.e., more than PageRank ○ anchor text indicates topic of the page, PageRank is topic-independent popularity of a page
  • 54. In association with and Anchor Text ● Can lead to Google Bombing: anyone can call you something bad
  • 55. In association with and PageRank ● Billions of web pages, some more informative than others ● Links can be viewed as information about the popularity (authority?) of a web page ○ can be used by ranking algorithm ● Inlink count could be used as simple measure ● Link analysis algorithms like PageRank provide more reliable ratings ○ less susceptible to link spam
  • 56. In association with and Random Surfer Model ● Browse the Web using the following algorithm: ○ Choose a random number r between 0 and 1: λ ○ With probability λ, the web surfer goes to a random page on the web (type a new URL in their browser) ○ With probability (1-λ) he/she clicks on one of the outlinks from the page ○ If r < λ: ■ Go to a random page ○ If r ≥ λ: ■ Click a link at random on the current page ○ Start again ● PageRank of a page is the probability that the “random surfer” will be looking at that page ○ links from popular pages will increase PageRank of pages they point to
  • 57. In association with and Dangling Links ● Random jump prevents getting stuck on pages that ○ do not have links ○ contains only links that no longer point to other pages ○ have links forming a loop ● Links that point to the first two types of pages are called dangling links ○ may also be links to pages that have not yet been crawled
  • 58. In association with and PageRank ● PageRank (PR) of page C = PR(A)/2 + PR(B)/1 ● More generally, ○ where Bu is the set of pages that point to u, and Lv is the number of outgoing links from page v (not counting duplicate links)
  • 59. In association with and PageRank ● Don’t know PageRank values at start ● Assume equal values (1/3 in this case), then iterate: ○ first iteration: PR(C) = 0.33/2 + 0.33 = 0.5, PR(A) = 0.33, and PR(B) = 0.17 ○ second: PR(C) = 0.33/2 + 0.17 = 0.33, PR(A) = 0.5, PR(B) = 0.17 ○ third: PR(C) = 0.42, PR(A) = 0.33, PR(B) = 0.25 ● Converges to PR(C) = 0.4, PR(A) = 0.4, and PR(B) = 0.2
  • 60. In association with and PageRank ● Taking random page jump into account, 1/3 chance of going to any page when r < λ ● PR(C) = λ/3 + (1 − λ) · (PR(A)/2 + PR(B)/1) ● More generally, ○ where N is the number of pages in the corpus (web), λ typically 0.15
  • 62. In association with and Link Quality ● Pagerank was designed for when humans thoughtfully linked to other pages ● Link quality is affected by spam and other factors ○ e.g., link farms to increase PageRank ○ trackback links in blogs can create loops ○ links from comments section of popular blogs ■ Blog services modify comment links to contain rel=nofollow attribute ■ e.g., “Come visit my <a rel=nofollow href="http://www.page.com">web page</a>.”
  • 63. In association with and Trackback Links ii