Εύρεση & ιαχείριση Πληροφορίας στον Παγκόσµιο Ιστό

Σχετικά έγγραφα
Ανάκληση Πληροφορίας. Information Retrieval. Διδάσκων Δημήτριος Κατσαρός

Ανάκληση Πληροφορίας. Information Retrieval. Διδάσκων Δημήτριος Κατσαρός

Εύρεση & ιαχείριση Πληροφορίας στον Παγκόσµιο Ιστό. Εισαγωγή στο µάθηµα. Εισαγωγή στην Ανάκτηση Πληροφορίας. Απαιτήσεις του µαθήµατος

2. Λεξιλόγιο Όρων και Λίστες Καταχωρήσεων

Ανάκληση Πληπουοπίαρ. Information Retrieval. Διδάζκων Δημήηριος Καηζαρός

Ανάκληση Πληποφοπίαρ. Information Retrieval. Διδάζκων Δημήηριος Καηζαρός

ΕΠΛ660 Ανάκτηση Πληροφοριών και Μηχανές Αναζήτησης

Ανάκληση Πληποφοπίαρ. Information Retrieval. Διδάζκων Δημήηριος Καηζαρός

Ανάκληση Πληποφοπίαρ. Information Retrieval. Διδάζκων Δημήηριος Καηζαρός

ΕΠΛ660 Ανάκτηση Πληροφοριών και Μηχανές Αναζήτησης

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

Information Retrieval

ΕΠΛ660 Ανάκτηση Πληροφοριών και Μηχανές Αναζήτησης

The Simply Typed Lambda Calculus

Πανεπιστήμιο Πειραιώς Σχολή Τεχνολογιών Πληροφορικής και Επικοινωνιών Τμήμα Ψηφιακών Συστημάτων Ανάκτηση Πληροφοριών

C.S. 430 Assignment 6, Sample Solutions

Information Retrieval

EE512: Error Control Coding

ΜΥΕ003-ΠΛΕ70: Ανάκτηση Πληροφορίας Διδάσκουσα: Ευαγγελία Πιτουρά. Κεφάλαιο 2: Κατασκευή Λεξιλογίου Όρων. Λίστες Καταχωρήσεων.

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

2 Composition. Invertible Mappings

Physical DB Design. B-Trees Index files can become quite large for large main files Indices on index files are possible.

Information Retrieval

ΕΠΛ660. Ανάκτηση Πληροφοριών και. Μάριος. ικαιάκος και Γιώργος Πάλλης

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006

Instruction Execution Times

MYE003: Ανάκτηση Πληροφορίας Διδάσκουσα: Ευαγγελία Πιτουρά. Κεφάλαιο 1: Εισαγωγή. Ανάκτηση Boole

MYE003: Ανάκτηση Πληροφορίας Διδάσκουσα: Ευαγγελία Πιτουρά. Κεφάλαιο 1: Εισαγωγή. Ανάκτηση Boole

Lecture 2. Soundness and completeness of propositional logic

MYE003: Ανάκτηση Πληροφορίας Διδάσκουσα: Ευαγγελία Πιτουρά. Κεφάλαιο 1: Εισαγωγή. Ανάκτηση Boole

Every set of first-order formulas is equivalent to an independent set

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

ΜΥΕ003-ΠΛΕ70: Ανάκτηση Πληροφορίας Διδάσκουσα: Ευαγγελία Πιτουρά. Κεφάλαιο 2: Κατασκευή Λεξιλογίου Όρων. Λίστες Καταχωρήσεων.

Information Retrieval

ΕΠΛ660 Ανάκτηση Πληροφοριών και Μηχανές Αναζήτησης

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

Homework 3 Solutions

Math 6 SL Probability Distributions Practice Test Mark Scheme

ΚΥΠΡΙΑΚΟΣ ΣΥΝΔΕΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY 21 ος ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ Δεύτερος Γύρος - 30 Μαρτίου 2011

Chapter 6: Systems of Linear Differential. be continuous functions on the interval

Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3

derivation of the Laplacian from rectangular to spherical coordinates

Example Sheet 3 Solutions

ΜΥΕ003-ΠΛΕ70: Ανάκτηση Πληροφορίας Διδάσκουσα: Ευαγγελία Πιτουρά. Κεφάλαιο 2: Κατασκευή Λεξιλογίου Όρων. Λίστες Καταχωρήσεων.

Introduction and Boolean Retrieval. Slides by Manning, Raghavan, Schutze

LESSON 14 (ΜΑΘΗΜΑ ΔΕΚΑΤΕΣΣΕΡΑ) REF : 202/057/34-ADV. 18 February 2014

Section 8.3 Trigonometric Equations

Introduction to Information Retrieval

Partial Trace and Partial Transpose

Numerical Analysis FMN011

Συντακτικές λειτουργίες

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

4.6 Autoregressive Moving Average Model ARMA(1,1)

Section 7.6 Double and Half Angle Formulas

Assalamu `alaikum wr. wb.

LESSON 12 (ΜΑΘΗΜΑ ΔΩΔΕΚΑ) REF : 202/055/32-ADV. 4 February 2014

Ευρετηρίαση ΜΕΡΟΣ ΙΙ

Concrete Mathematics Exercises from 30 September 2016

[1] P Q. Fig. 3.1

Ανάκτηση Πληροφορίας (Information Retrieval IR)

6.1. Dirac Equation. Hamiltonian. Dirac Eq.

Other Test Constructions: Likelihood Ratio & Bayes Tests

Πρόβλημα 1: Αναζήτηση Ελάχιστης/Μέγιστης Τιμής

Finite Field Problems: Solutions

Advanced Subsidiary Unit 1: Understanding and Written Response

ΕΠΛ660 Ανάκτηση Πληροφοριών και Μηχανές Αναζήτησης

Block Ciphers Modes. Ramki Thurimella

Partial Differential Equations in Biology The boundary element method. March 26, 2013

Συστήματα Διαχείρισης Βάσεων Δεδομένων

ΕΠΙΧΕΙΡΗΣΙΑΚΗ ΑΛΛΗΛΟΓΡΑΦΙΑ ΚΑΙ ΕΠΙΚΟΙΝΩΝΙΑ ΣΤΗΝ ΑΓΓΛΙΚΗ ΓΛΩΣΣΑ

Approximation of distance between locations on earth given by latitude and longitude

Paper Reference. Paper Reference(s) 1776/04 Edexcel GCSE Modern Greek Paper 4 Writing. Thursday 21 May 2009 Afternoon Time: 1 hour 15 minutes

department listing department name αχχουντσ ϕανε βαλικτ δδσϕηασδδη σδηφγ ασκϕηλκ τεχηνιχαλ αλαν ϕουν διξ τεχηνιχαλ ϕοην µαριανι

Writing for A class. Describe yourself Topic 1: Write your name, your nationality, your hobby, your pet. Write where you live.

Solutions to Exercise Sheet 5

SCHOOL OF MATHEMATICAL SCIENCES G11LMA Linear Mathematics Examination Solutions

Elements of Information Theory

5.4 The Poisson Distribution.

The challenges of non-stable predicates

Ανάκτηση Πληροφορίας (Information Retrieval IR) ιδακτικό βοήθηµα 2. Πανεπιστήµιο Θεσσαλίας Πολυτεχνική Σχολή Τµήµα Μηχ. Η/Υ, Τηλ/νιών & ικτύων

Πανεπιστήμιο Κρήτης, Τμήμα Επιστήμης Υπολογιστών Άνοιξη HΥ463 - Συστήματα Ανάκτησης Πληροφοριών Information Retrieval (IR) Systems

Code Breaker. TEACHER s NOTES

TMA4115 Matematikk 3

Main source: "Discrete-time systems and computer control" by Α. ΣΚΟΔΡΑΣ ΨΗΦΙΑΚΟΣ ΕΛΕΓΧΟΣ ΔΙΑΛΕΞΗ 4 ΔΙΑΦΑΝΕΙΑ 1

Chapter 2 * * * * * * * Introduction to Verbs * * * * * * *

Right Rear Door. Let's now finish the door hinge saga with the right rear door

Math221: HW# 1 solutions

ΑΓΓΛΙΚΗ ΓΛΩΣΣΑ ΣΕ ΕΙΔΙΚΑ ΘΕΜΑΤΑ ΔΙΕΘΝΩΝ ΣΧΕΣΕΩΝ & ΟΙΚΟΝΟΜΙΑΣ

Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in

Ανάκτηση Πληροφορίας

ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΑΤΡΩΝ ΠΟΛΥΤΕΧΝΙΚΗ ΣΧΟΛΗ ΤΜΗΜΑ ΜΗΧΑΝΙΚΩΝ Η/Υ & ΠΛΗΡΟΦΟΡΙΚΗΣ. του Γεράσιμου Τουλιάτου ΑΜ: 697

Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit

Μηχανική Μάθηση Hypothesis Testing

Review Test 3. MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Ανάκληση Πληποφοπίαρ. Information Retrieval. Διδάζκων Δημήηριος Καηζαρός

Matrices and Determinants

Example of the Baum-Welch Algorithm

Abstract Storage Devices

ΦΥΛΛΟ ΕΡΓΑΣΙΑΣ Α. Διαβάστε τις ειδήσεις και εν συνεχεία σημειώστε. Οπτική γωνία είδησης 1:.

Transcript:

Εύρεση & ιαχείριση Πληροφορίας στον Παγκόσµιο Ιστό ιδάσκων ηµήτριος Κατσαρός, Ph.D. @ Τµ. Μηχανικών Η/Υ, Τηλεπικοινωνιών & ικτύων Πανεπιστήµιο Θεσσαλίας ιάλεξη 1η: 14/02/2007 1

Εισαγωγή στο µάθηµα & Εισαγωγή στην Ανάκτηση Πληροφορίας 2

Απαιτήσεις του µαθήµατος ιαλέξεις: ~14 - Τετάρτη 16:00 19:00 http://skyblue.csd.auth.gr/~dimitris/courses/ir_spring06.htm Εργασία απαραίτητη: 30% του τελικού βαθµού, εφόσον η γραπτή εξέταση βαθµολογηθεί µε 6.5 Εργασία της επιλογής σας ή (σε έλλειψή της) µε επιλογήτουδιδάσκοντα Testbed για υλοποίηση ιδεών: QuadSearch Αποτέλεσµα περσινής εργασίας και φιλότιµης προσπάθειας υποβολή σε συνέδριο: εκέµβριος 2006 υποβολή σε περιοδικό: Φεβρουάριος 2007 υπο προετοιµασία για δηµοσιοποίηση σε mailing lists και δηµοσίευση σε magazine Κύριος στόχος της εργασίας: η δηµοσίευση! 3

Λέξεις-κλειδιά του µαθήµατος Boolean model, dictionary and postings lists, tolerant retrieval, index construction, index compression, scoring and term weighting, vector space retrieval, recall and precision, relevance feedback and query expansion, probabilistic information retrieval, support vector machines and kernel functions, dimensionality reduction and latent semantic indexing, Sparse matrix storage, compressed row storage, compressed column storage, low-rank approximations, QR factorization, singular value decomposition, Web search basics, Web crawling and indexes, link analysis, ranking Webpages by popularity, Summation formula for PageRank, problems with the iterative process, Markov chain theory, spectrum of the Google matrix, parameters in the PageRank model, hyperlink matrix, teleportation matrix, Sensitivity of PageRank, the PageRank problem as a linear system, proof of the PageRank sparse linear system, Large-scale implementation of PageRank, back button modeling, adaptive power method, extrapolation, aggregation, updating the PageRank vector, HITS method for ranking Webpages, HITS implementation, HITS convergence, HITS's relationship to bibliometrics, query-independent HITS, HITS sensitivity, SALSA, hybrid ranking methods, rankings based on traffic flow, spam, personalization, clustering, trends and time-sensitive search, privacy and censorship. 4

ιδακτικό βοήθηµα 1 Καλύπτει το 65% του αντικειµένου του µαθήµατος Παραδοσιακή & Σύχρονη IR Είναι στην αγγλική ( ΩΡΕΑΝ το pdf από τον διδάσκοντα) 355 σελίδες 1η έκδοση (Σεπτέµβριος, 2007) ~?? Αναλυτικό & κατανοητό, διδακτικές ασκήσεις Introduction to Information Retrieval Christopher D. Manning Prabhakar Raghavan Hinrich Schutze Cambridge University Press 5

ιδακτικό βοήθηµα 2 Καλύπτει το 50% του αντικειµένου του µαθήµατος Link Analysis Ranking Είναι στην αγγλική 232 σελίδες 1η έκδοση (Αύγουστος, 2006) ~35 Αναλυτικό, αυστηρά θεµελιωµένο, αλλά κατανοητό 6

ιδακτικό βοήθηµα υποβάθρου Άλγεβρα πινάκων Είναι στην αγγλική 694 σελίδες 3η έκδοση (Οκτώβριος, 1996) ~50 Αυστηρά θεµελιωµένο 7

ιδακτικό βοήθηµα 3 Καλύπτει το 40% του αντικειµένου του µαθήµατος Είναι στην αγγλική 510 σελίδες 1η έκδοση (Μάιος, 1999) ~50 Αναλυτικό & κατανοητό 8

ιδακτικό βοήθηµα 4 Καλύπτει το 10% του αντικειµένου του µαθήµατος Είναι στην αγγλική 520 σελίδες 2η έκδοση (Μάιος, 1999) ~70 Αναλυτικότατο & κατανοητό 9

ιδακτικό βοήθηµα 5 Καλύπτει το 10% του αντικειµένου του µαθήµατος Είναι στην αγγλική 350 σελίδες 1η έκδοση (Μάιος, 1999) ~60 Paper-like µορφή 10

ιδακτικό βοήθηµα 6 Καλύπτει το 5% του αντικειµένου του µαθήµατος Είναι στην αγγλική 250 σελίδες 1η έκδοση (Σεπτέµβριος, 2003) ~60 Ανεξάρτητα κεφάλαια 11

Unstructured (text) vs. structured (database) data in 1996 160 140 120 100 80 60 Unstructured Structured 40 20 0 Data volume Market Cap 12

Unstructured (text) vs. structured (database) data in 2006 160 140 120 100 80 60 Unstructured Structured 40 20 0 Data volume Market Cap 13

Unstructured data in 1650 Which plays of Shakespeare contain the words Brutus AND Caesar but NOT Calpurnia? One could grep all of Shakespeare s plays for Brutus and Caesar, then strip out lines containing Calpurnia? Slow (for large corpora) NOT Calpurnia is non-trivial Other operations (e.g., find the word Romans near countrymen) not feasible Ranked retrieval (best documents to return) Later lectures 14

Term-document incidence Antony and Cleopatra Julius Caesar The Tempest Hamlet Othello Macbeth Antony 1 1 0 0 0 1 Brutus 1 1 0 1 0 0 Caesar 1 1 0 1 1 1 Calpurnia 0 1 0 0 0 0 Cleopatra 1 0 0 0 0 0 mercy 1 0 1 1 1 1 worser 1 0 1 1 1 0 Brutus AND Caesar but NOT Calpurnia 1 if play contains word, 0 otherwise 15

Incidence vectors So we have a 0/1 vector for each term. To answer query: take the vectors for Brutus, Caesar and Calpurnia (complemented) bitwise AND. 110100 AND 110111 AND 101111 = 100100. 16

Answers to query Antony and Cleopatra, Act III, Scene ii Agrippa [Aside to DOMITIUS ENOBARBUS]: Why, Enobarbus, When Antony found Julius Caesar dead, He cried almost to roaring; and he wept When at Philippi he found Brutus slain. Hamlet, Act III, Scene ii Lord Polonius: I did enact Julius Caesar I was killed i' the Capitol; Brutus killed me. 17

Bigger corpora Consider N = 1M documents, each with about 1K terms. Avg 6 bytes/term incl spaces/punctuation 6GB of data in the documents. Say there are m = 500K distinct terms among these. 18

Can t build the matrix 500K x 1M matrix has half-a-trillion 0 s and 1 s. But it has no more than one billion 1 s. matrix is extremely sparse. What s a better representation? We only record the 1 positions. Why? 19

Inverted index For each term T, we must store a list of all documents that contain T. Do we use an array or a list for this? Brutus Calpurnia Caesar 2 4 8 16 32 64 128 1 2 3 5 8 13 21 34 13 16 What happens if the word Caesar is added to document 14? 20

Inverted index Linked lists generally preferred to arrays Dynamic space allocation Insertion of terms into documents easy Space overhead of pointers Posting Brutus Calpurnia Caesar 2 4 8 16 32 64 128 1 2 3 5 8 13 21 34 13 16 Dictionary Postings lists Sorted by docid (more later on why). 21

Inverted index construction Documents to be indexed. Friends, Romans, countrymen. Tokenizer Token stream. Friends Romans Countrymen Linguistic modules Modified tokens. friend roman countryman More on these later. Inverted index. Indexer friend roman countryman 2 4 1 2 13 16 22

Indexer steps Sequence of (Modified token, Document ID) pairs. Doc 1 I did enact Julius Caesar I was killed i' the Capitol; Brutus killed me. Doc 2 So let it be with Caesar. The noble Brutus hath told you Caesar was ambitious Term Doc # I 1 did 1 enact 1 julius 1 caesar 1 I 1 was 1 killed 1 i' 1 the 1 capitol 1 brutus 1 killed 1 me 1 so 2 let 2 it 2 be 2 with 2 caesar 2 the 2 noble 2 brutus 2 hath 2 told 2 you 2 caesar 2 was 2 ambitious 2 23

Sort by terms. Core indexing step. Term Doc # I 1 did 1 enact 1 julius 1 caesar 1 I 1 was 1 killed 1 i' 1 the 1 capitol 1 brutus 1 killed 1 me 1 so 2 let 2 it 2 be 2 with 2 caesar 2 the 2 noble 2 brutus 2 hath 2 told 2 you 2 caesar 2 was 2 ambitious 2 Term Doc # ambitious 2 be 2 brutus 1 brutus 2 capitol 1 caesar 1 caesar 2 caesar 2 did 1 enact 1 hath 1 I 1 I 1 i' 1 it 2 julius 1 killed 1 killed 1 let 2 me 1 noble 2 so 2 the 1 the 2 told 2 you 2 was 1 was 2 with 2 24

Multiple term entries in a single document are merged. Frequency information is added. Why frequency? Will discuss later. Term Doc # ambitious 2 be 2 brutus 1 brutus 2 capitol 1 caesar 1 caesar 2 caesar 2 did 1 enact 1 hath 1 I 1 I 1 i' 1 it 2 julius 1 killed 1 killed 1 let 2 me 1 noble 2 so 2 the 1 the 2 told 2 you 2 was 1 was 2 with 2 Term Doc # Term freq ambitious 2 1 be 2 1 brutus 1 1 brutus 2 1 capitol 1 1 caesar 1 1 caesar 2 2 did 1 1 enact 1 1 hath 2 1 I 1 2 i' 1 1 it 2 1 julius 1 1 killed 1 2 let 2 1 me 1 1 noble 2 1 so 2 1 the 1 1 the 2 1 told 2 1 you 2 1 was 1 1 was 2 1 with 2 1 25

The result is split into a Dictionary file and a Postings file. Term Doc # Freq ambitious 2 1 be 2 1 brutus 1 1 brutus 2 1 capitol 1 1 caesar 1 1 caesar 2 2 did 1 1 enact 1 1 hath 2 1 I 1 2 i' 1 1 it 2 1 julius 1 1 killed 1 2 let 2 1 me 1 1 noble 2 1 so 2 1 the 1 1 the 2 1 told 2 1 you 2 1 was 1 1 was 2 1 with 2 1 Term N docs Coll freq ambitious 1 1 be 1 1 brutus 2 2 capitol 1 1 caesar 2 3 did 1 1 enact 1 1 hath 1 1 I 1 2 i' 1 1 it 1 1 julius 1 1 killed 1 2 let 1 1 me 1 1 noble 1 1 so 1 1 the 2 2 told 1 1 you 1 1 was 2 2 with 1 1 Doc # Freq 2 1 2 1 1 1 2 1 1 1 1 1 2 2 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 2 2 1 1 1 2 1 2 1 1 1 2 1 2 1 2 1 1 1 2 1 2 1 26

Where do we pay in storage? Terms Term N docs Coll freq ambitious 1 1 be 1 1 brutus 2 2 capitol 1 1 caesar 2 3 did 1 1 enact 1 1 hath 1 1 I 1 2 i' 1 1 it 1 1 julius 1 1 killed 1 2 let 1 1 me 1 1 noble 1 1 so 1 1 the 2 2 told 1 1 you 1 1 was 2 2 with 1 1 Pointers Doc # Freq 2 1 2 1 1 1 2 1 1 1 1 1 2 2 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 2 2 1 1 1 2 1 2 1 1 1 2 1 2 1 2 1 1 1 2 1 2 1 Will quantify the storage, later. 27

The index we just built How do we process a query? Today s focus Later - what kinds of queries can we process? 28

Query processing: AND Consider processing the query: Brutus AND Caesar Locate Brutus in the Dictionary; Retrieve its postings. Locate Caesar in the Dictionary; Retrieve its postings. Merge the two postings: 2 4 8 16 32 64 1 2 3 5 8 13 21 128 34 Brutus Caesar 29

The merge Walk through the two postings simultaneously, in time linear in the total number of postings entries 2 8 2 4 8 16 32 64 1 2 3 5 8 13 21 128 34 Brutus Caesar If the list lengths are x and y, the merge takes O(x+y) operations. Crucial: postings sorted by docid. 30

Boolean queries: Exact match The Boolean Retrieval model is being able to ask a query that is a Boolean expression: Boolean Queries are queries using AND, OR and NOT to join query terms Views each document as a set of words Is precise: document matches condition or not. Primary commercial retrieval tool for 3 decades. Professional searchers (e.g., lawyers) still like Boolean queries: You know exactly what you re getting. 31

Example: WestLaw http://www.westlaw.com/ Largest commercial (paying subscribers) legal search service (started 1975; ranking added 1992) Tens of terabytes of data; 700,000 users Majority of users still use boolean queries Example query: What is the statute of limitations in cases involving the federal tort claims act? LIMIT! /3 STATUTE ACTION /S FEDERAL /2 TORT /3 CLAIM /3 = within 3 words, /S = in same sentence 32

Example: WestLaw http://www.westlaw.com/ Another example query: Requirements for disabled people to be able to access a workplace disabl! /p access! /s work-site work-place (employment /3 place Note that SPACE is disjunction, not conjunction! Long, precise queries; proximity operators; incrementally developed; not like web search Professional searchers often like Boolean search: Precision, transparency and control But that doesn t mean they actually work better. 33

Boolean queries: More general merges Exercise: Adapt the merge for the queries: Brutus AND NOT Caesar Brutus OR NOT Caesar Can we still run through the merge in time O(x+y) or what can we achieve? 34

Merging What about an arbitrary Boolean formula? (Brutus OR Caesar) AND NOT (Antony OR Cleopatra) Can we always merge in linear time? Linear in what? Can we do better? 35

Query optimization What is the best order for query processing? Consider a query that is an AND of t terms. For each of the t terms, get its postings, then AND them together. Brutus Calpurnia Caesar 2 4 8 16 32 64 128 1 2 3 5 8 16 21 34 13 16 Query: Brutus AND Calpurnia AND Caesar 36

Query optimization example Process in order of increasing freq: start with smallest set, then keep cutting further. This is why we kept freq in dictionary Brutus Calpurnia Caesar 2 4 8 16 32 64 128 1 2 3 5 8 13 21 34 13 16 Execute the query as (Caesar AND Brutus) AND Calpurnia. 37

More general optimization e.g., (madding OR crowd) AND (ignoble OR strife) Get freq s for all terms. Estimate the size of each OR by the sum of its freq s (conservative). Process in increasing order of OR sizes. 38

Exercise Recommend a query processing order for (tangerine OR trees) AND (marmalade OR skies) AND (kaleidoscope OR eyes) Term Freq eyes 213312 kaleidoscope 87009 marmalade 107913 skies 271658 tangerine 46653 trees 316812 39

Query processing exercises If the query is friends AND romans AND (NOT countrymen), how could we use the freq of countrymen? Exercise: Extend the merge to an arbitrary Boolean query. Can we always guarantee execution in time linear in the total postings size? Hint: Begin with the case of a Boolean formula query: in this, each query term appears only once in the query. 40

Exercise Try the search feature at http://www.rhymezone.com/shakespeare/ Write down five search features you think it could do better 41

What s ahead in IR? Beyond term search What about phrases? Stanford University Proximity: Find Gates NEAR Microsoft. Need index to capture position information in docs. More later. Zones in documents: Find documents with (author = Ullman) AND (text contains automata). 42

Evidence accumulation 1 vs. 0 occurrence of a search term 2 vs. 1 occurrence 3 vs. 2 occurrences, etc. Usually more seems better Need term frequency information in docs 43

Ranking search results Boolean queries give inclusion or exclusion of docs. Often we want to rank/group results Need to measure proximity from query to each doc. Need to decide whether docs presented to user are singletons, or a group of docs covering various aspects of the query. 44

IR vs. databases: Structured vs unstructured data Structured data tends to refer to information in tables Employee Manager Salary Smith Jones 50000 Chang Smith 60000 Ivy Smith 50000 Typically allows numerical range and exact match (for text) queries, e.g., Salary < 60000 AND Manager = Smith. 45

Unstructured data Typically refers to free text Allows Keyword queries including operators More sophisticated concept queries e.g., find all web pages dealing with drug abuse Classic model for searching text documents 46

Semi-structured data In fact almost no data is unstructured E.g., this slide has distinctly identified zones such as the Title and Bullets Facilitates semi-structured search such as Title contains data AND Bullets contain search to say nothing of linguistic structure 47

More sophisticated semi-structured search Title is about Object Oriented Programming AND Author something like stro*rup where * is the wild-card operator Issues: how do you process about? how do you rank results? The focus of XML search. 48

Clustering and classification Given a set of docs, group them into clusters based on their contents. Given a set of topics, plus a new doc D, decide which topic(s) D belongs to. 49

The web and its challenges Unusual and diverse documents Unusual and diverse users, queries, information needs Beyond terms, exploit ideas from social networks link analysis, clickstreams... How do search engines work? And how can we make them better? 50

More sophisticated information retrieval Cross-language information retrieval Question answering Summarization Text mining 51

Dictionary και Postings 52

Στη διάλεξη αυτή Finish basic indexing The Dictionary Tokenization What terms do we put in the index? Postings Query processing faster merges Proximity/phrase queries 53

Recall basic indexing pipeline Documents to be indexed. Friends, Romans, countrymen. Tokenizer Token stream. Friends Romans Countrymen Linguistic modules Modified tokens. friend roman countryman Inverted index. Indexer friend roman countryman 2 4 1 2 13 16 54

Parsing a document What format is it in? pdf/word/excel/html? What language is it in? What character set is in use? Each of these is a classification problem, which we will study later in the course. But these tasks are often done heuristically 55

Complications: Format/language Documents being indexed can include docs from many different languages A single index may have to contain terms of several languages. Sometimes a document or its components can contain multiple languages/formats French email with a German pdf attachment. What is a unit document? A file? An email? (Perhaps one of many in an mbox.) An email with 5 attachments? A group of files (PPT or LaTeX in HTML) 56

Tokenization 57

Tokenization Input: Friends, Romans and Countrymen Output: Tokens Friends Romans Countrymen Each such token is now a candidate for an index entry, after further processing Described below But what are valid tokens to emit? 58

Tokenization Issues in tokenization: Finland s capital Finland? Finlands? Finland s? Hewlett-Packard Hewlett and Packard as two tokens? State-of-the-art: break up hyphenated sequence. co-education? the hold-him-back-and-drag-him-away-maneuver? It s effective to get the user to put in possible hyphens San Francisco: one token or two? How do you decide it is one token? 59

Numbers 3/12/91 Mar. 12, 1991 55 B.C. B-52 My PGP key is 324a3df234cb23e 100.2.86.144 Often, don t index as text. But often very useful: think about things like looking up error codes/stacktraces on the web (One answer is using n-grams: Lecture 3) Will often index meta-data separately Creation date, format, etc. 60

Tokenization: Language issues L'ensemble one token or two? L? L? Le? Want l ensemble to match with un ensemble German noun compounds are not segmented Lebensversicherungsgesellschaftsangestellter life insurance company employee 61

Tokenization: language issues Chinese and Japanese have no spaces between words: 莎拉波娃现在居住在美国东南部的佛罗里达 Not always guaranteed a unique tokenization Further complicated in Japanese, with multiple alphabets intermingled Dates/amounts in multiple formats フォーチュン 500 社は情報不足のため時間あた $500K( 約 6,000 万円 ) Katakana Hiragana Kanji Romaji End-user can express query entirely in hiragana! 62

Tokenization: language issues Arabic (or Hebrew) is basically written right to left, but with certain items like numbers written left to right Words are separated, but letter forms within a word form complex ligatures استقلت الجزاي ر في سنة 1962 بعد 132 عاما من الاحتلال الفرنسي. start Algeria achieved its independence in 1962 after 132 years of French occupation. With Unicode, the surface presentation is complex, but the stored form is straightforward 63

Normalization Need to normalize terms in indexed text as well as query terms into the same form We want to match U.S.A. and USA We most commonly implicitly define equivalence classes of terms e.g., by deleting periods in a term Alternative is to do asymmetric expansion: Enter: window Enter: windows Enter: Windows Search: window, windows Search: Windows, windows Search: Windows Potentially more powerful, but less efficient 64

Normalization: other languages Accents: résumé vs. resume. Most important criterion: How are your users like to write their queries for these words? Even in languages that standardly have accents, users often may not type them German: Tuebingen vs. Tübingen Should be equivalent 65

Normalization: other languages Need to normalize indexed text as well as query terms into the same form 7 月 30 日 vs. 7/30 Character-level alphabet detection and conversion Tokenization not separable from this. Sometimes ambiguous: Is this Morgen will ich in MIT German mit? 66

Case folding Reduce all letters to lower case exception: upper case (in mid-sentence?) e.g., General Motors Fed vs. fed SAIL vs. sail Often best to lower case everything, since users will use lowercase regardless of correct capitalization 67

Stop words With a stop list, you exclude from dictionary entirely the commonest words. Intuition: They have little semantic content: the, a, and, to, be They take a lot of space: ~30% of postings for top 30 But the trend is away from doing this: Good compression techniques (lecture 5) means the space for including stopwords in a system is very small Good query optimization techniques mean you pay little at query time for including stop words. You need them for: Phrase queries: King of Denmark Various song titles, etc.: Let it be, To be or not to be Relational queries: flights to London 68

Thesauri and soundex Handle synonyms and homonyms Hand-constructed equivalence classes e.g., car = automobile color = colour Rewrite to form equivalence classes Index such equivalences When the document contains automobile, index it under car as well (usually, also vice-versa) Or expand query? When the query contains automobile, look under car as well 69

Soundex Traditional class of heuristics to expand a query into phonetic equivalents Language specific mainly for names E.g., chebyshev tchebycheff More on this later... 70

Lemmatization Reduce inflectional/variant forms to base form E.g., am, are, is be car, cars, car's, cars' car the boy's cars are different colors the boy car be different color Lemmatization implies doing proper reduction to dictionary headword form 71

Stemming Reduce terms to their roots before indexing Stemming suggest crude affix chopping language dependent e.g., automate(s), automatic, automation all reduced to automat. for example compressed and compression are both accepted as equivalent to compress. for exampl compress and compress ar both accept as equival to compress 72

Porter s algorithm Commonest algorithm for stemming English Results suggest at least as good as other stemming options Conventions + 5 phases of reductions phases applied sequentially each phase consists of a set of commands sample convention: Of the rules in a compound command, select the one that applies to the longest suffix. 73

Typical rules in Porter sses ss ies i ational ate tional tion Weight of word sensitive rules (m>1) EMENT replacement replac cement cement 74

Other stemmers Other stemmers exist, e.g., Lovins stemmer http://www.comp.lancs.ac.uk/computing/research/stemming/general/lovins.htm Single-pass, longest suffix removal (about 250 rules) Motivated by linguistics as well as IR Full morphological analysis at most modest benefits for retrieval Do stemming and other normalizations help? Often very mixed results: really help recall for some queries but harm precision on others 75

Language-specificity Many of the above features embody transformations that are Language-specific and Often, application-specific These are plug-in addenda to the indexing process Both open source and commercial plug-ins available for handling these 76

Dictionary entries first cut ensemble.french 時間.japanese MIT.english mit.german guaranteed.english entries.english sometimes.english These may be grouped by language (or not ). More on this in ranking/query processing. tokenization.english 77

Faster postings merges: Skip pointers 78

Recall basic merge Walk through the two postings simultaneously, in time linear in the total number of postings entries 2 8 2 4 8 16 32 64 1 2 3 5 8 17 21 128 31 Brutus Caesar If the list lengths are m and n, the merge takes O(m+n) operations. Can we do better? Yes, if index isn t changing too fast. 79

Augment postings with skip pointers (at indexing time) 16 128 2 4 8 16 32 64 128 8 31 1 2 3 5 8 17 21 31 Why? To skip postings that will not figure in the search results. How? Where do we place skip pointers? 80

Query processing with skip pointers 16 128 2 4 8 16 32 64 128 8 31 1 2 3 5 8 17 21 31 Suppose we ve stepped through the lists until we process 8 on each list. When we get to 16 on the top list, we see that its successor is 32. But the skip successor of 8 on the lower list is 31, so we can skip ahead past the intervening postings. 81

Where do we place skips? Tradeoff: More skips shorter skip spans more likely to skip. But lots of comparisons to skip pointers. Fewer skips few pointer comparison, but then long skip spans few successful skips. 82

Placing skips Simple heuristic: for postings of length L, use L evenly-spaced skip pointers. This ignores the distribution of query terms. Easy if the index is relatively static; harder if L keeps changing because of updates. This definitely used to help; with modern hardware it may not (Bahle et al. 2002) The cost of loading a bigger postings list outweighs the gain from quicker in memory merging 83

Phrase queries 84

Phrase queries Want to answer queries such as stanford university as a phrase Thus the sentence I went to university at Stanford is not a match. The concept of phrase queries has proven easily understood by users; about 10% of web queries are phrase queries No longer suffices to store only <term : docs> entries 85

A first attempt: Biword indexes Index every consecutive pair of terms in the text as a phrase For example the text Friends, Romans, Countrymen would generate the biwords friends romans romans countrymen Each of these biwords is now a dictionary term Two-word phrase query-processing is now immediate. 86

Longer phrase queries Longer phrases are processed as we did with wildcards: stanford university palo alto can be broken into the Boolean query on biwords: stanford university AND university palo AND palo alto Without the docs, we cannot verify that the docs matching the above Boolean query do contain the phrase. Can have false positives! 87

Extended biwords Parse the indexed text and perform part-of-speech-tagging (POST). Bucket the terms into (say) Nouns (N) and articles/prepositions (X). Now deem any string of terms of the form NX*N to be an extended biword. Each such extended biword is now made a term in the dictionary. Example: catcher in the rye N X X N Query processing: parse it into N s and X s Segment query into enhanced biwords Look up index 88

Issues for biword indexes False positives, as noted before Index blowup due to bigger dictionary For extended biword index, parsing longer queries into conjunctions: E.g., the query tangerine trees and marmalade skies is parsed into tangerine trees AND trees and marmalade AND marmalade skies Not standard solution (for all biwords) 89

Solution 2: Positional indexes Store, for each term, entries of the form: <number of docs containing term; doc1: position1, position2 ; doc2: position1, position2 ; etc.> 90

Positional index example <be: 993427; 1: 7, 18, 33, 72, 86, 231; 2: 3, 149; 4: 17, 191, 291, 430, 434; 5: 363, 367, > Which of docs 1,2,4,5 could contain to be or not to be? Can compress position values/offsets Nevertheless, this expands postings storage substantially 91

Processing a phrase query Extract inverted index entries for each distinct term: to, be, or, not. Merge their doc:position lists to enumerate all positions with to be or not to be. to: be: 2:1,17,74,222,551; 4:8,16,190,429,433; 7:13,23,191;... 1:17,19; 4:17,191,291,430,434; 5:14,19,101;... Same general method for proximity searches 92

Proximity queries LIMIT! /3 STATUTE /3 FEDERAL /2 TORT Here, /k means within k words of. Clearly, positional indexes can be used for such queries; biword indexes cannot. Exercise: Adapt the linear merge of postings to handle proximity queries. Can you make it work for any value of k? 93

Positional index size You can compress position values/offsets: we ll talk bout that in lecture 5 Nevertheless, a positional index expands postings storage substantially Nevertheless, it is now standardly used because of the power and usefulness of phrase and proximity queries whether used explicitly or implicitly in a ranking retrieval system. 94

Positional index size Need an entry for each occurrence, not just once per document Index size depends on average document size Average web page has <1000 terms SEC filings, books, even some epic poems easily 100,000 terms Consider a term with frequency 0.1% Why? Document size Postings Positional postings 1000 1 1 100,000 1 100 95

Rules of thumb A positional index is 2 4 as large as a nonpositional index Positional index size 35 50% of volume of original text Caveat: all of this holds for English-like languages 96

Combination schemes These two approaches can be profitably combined For particular phrases ( Michael Jackson, Britney Spears ) it is inefficient to keep on merging positional postings lists Even more so for phrases like The Who Williams et al. (2004) evaluate a more sophisticated mixed indexing scheme A typical web query mixture was executed in ¼ of the time of using just a positional index It required 26% more space than having a positional index alone 97

Resources for today s lecture IIR 2 MG 3.6, 4.3; MIR 7.2 Porter s stemmer: http://www.tartarus.org/~martin/porterstemmer/ Skip Lists theory: Pugh (1990) Multilevel skip lists give same O(log n) efficiency as trees H.E. Williams, J. Zobel, and D. Bahle. 2004. Fast Phrase Querying with Combined Indexes, ACM Transactions on Information Systems. http://www.seg.rmit.edu.au/research/research.php?author=4 D. Bahle, H. Williams, and J. Zobel. Efficient phrase querying with an auxiliary index. SIGIR 2002, pp. 215-221. 98