information-retrieval: vektorraum-modell · 03. dezember 2009 text-engineering i -...

64
Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur Information-Retrieval: Vektorraum-Modell Claes Neuefeind Fabian Steeg 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit¨ at zu K¨ oln

Upload: others

Post on 18-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Information-Retrieval:Vektorraum-Modell

Claes NeuefeindFabian Steeg

03. Dezember 2009

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 2: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Themen des Seminars

I Boolesches Retrieval-Modell (IIR 1)

I Datenstrukturen (IIR 2)

I Tolerantes Retrieval (IIR 3)

I Vektorraum-Modell (IIR 6)

I Evaluation (IIR 8)

I Web-Retrieval (IIR 19-21)

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 3: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Wiederholung: Boolesches Retrieval

I Suche alle Dokumente, die Term(e) der Anfrage enthaltenI ’Ganz oder gar nicht’I Gut fur Experten und Anwendungen, weniger gut fur Nutzer

I Erweiterungen:I Positional Index (Phrasen, Nahe)I Permuterm- oder k-gram-Index

(Unscharfes Matchen, Korrekturen)

I Ranking?

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 4: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Ranking

I Grundgedanke:I Bewertung von Term/Dokument-Paaren durch einen ’Score’,

der die Relevanz des Terms fur das Dokument wiedergibt

I Ansatze:I Parameter und BereicheI Termgewichtung

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 5: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Parameter und Bereiche

Gewichtung

Vektorraum-Modell

VSM vs. Boole

Literatur

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 6: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Parameter

I Nutzung von Metadaten:I Strukturierte Informationen uber das DokumentI Kontrolliertes Vokabular

I Invertierter Index unzureichendI Erweiterung:

I Parameter in Index aufnehmen→ Zuordnung Dokument - Felder

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 7: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Dokumentbereiche

I Dokumentbereiche mit Freitext

Abbildung: www.informationretrieval.org

I Erweiterter Index:Bereiche als Attribute von Termen

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 8: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Dokumentbereiche

I Besser: Dokumentbereiche als Attribute von Dokumenten

Abbildung: www.informationretrieval.org

I Dictionary bleibt (relativ) klein

I Vereinfacht Berechnung(vgl. Postings Intersection)

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 9: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Weighted Zone Scoring

I Bewertung durch Gewichtung von BereichenI ’Ranked Boolean Retrieval’

∑li=1 gisi

I l = Anzahl BereicheI g = Gewicht des BereichsI s = Boolescher Score (1/0)

I Gewichte festlegen oder berechnen

I Alternativ: Gewichte induktiv lernen

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 10: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Bisher: Matrix mit Binarwerten

Anthony Julius The Hamlet Othello Macbeth . . .and Caesar Tempest

CleopatraAnthony 1 1 0 0 0 1Brutus 1 1 0 1 0 0Caesar 1 1 0 1 1 1Calpurnia 0 1 0 0 0 0Cleopatra 1 0 0 0 0 0mercy 1 0 1 1 1 1worser 1 0 1 1 1 0. . .

Dokumente als binare Vektoren ∈ {0, 1}|V |.

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 11: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Bisher: Matrix mit Binarwerten

Anthony Julius The Hamlet Othello Macbeth . . .and Caesar Tempest

CleopatraAnthony 1 1 0 0 0 1Brutus 1 1 0 1 0 0Caesar 1 1 0 1 1 1Calpurnia 0 1 0 0 0 0Cleopatra 1 0 0 0 0 0mercy 1 0 1 1 1 1worser 1 0 1 1 1 0. . .

Dokumente als binare Vektoren ∈ {0, 1}|V |.

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 12: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Alternative: Nutzung der Termfrequenz

Anthony Julius The Hamlet Othello Macbeth . . .and Caesar Tempest

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

Dokumente als Vektoren mit naturlichen Zahlen ∈ N|V |.

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 13: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Alternative: Nutzung der Termfrequenz

Anthony Julius The Hamlet Othello Macbeth . . .and Caesar Tempest

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

Dokumente als Vektoren mit naturlichen Zahlen ∈ N|V |.

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 14: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Termgewichtung und Ranking

I Ideen fur Termgewichtung aus TextstatistikI These von [Luhn, 1957]:

I Termverteilung spiegelt Inhalt von Dokumenten widerI Termhaufigkeit und -dichte sind Faktoren fur Signifikanz

→ Termverteilung als Basis fur Reprasentation

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 15: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Termgewichtung: tf

I Termfrequenz (tf):Haufigkeit eines Terms innerhalb eines Dokuments

I Berechnung des Scores fur ein Anfrage/Dokument-Paar:

Score(q, d) =∑

t∈q∩d tft,d

I Probleme:I kein direkter Zusammenhang Haufigkeit/Relevanz

(lange Dokumente)I Terme nicht alle gleich wichtig (’Stoppworter’)

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 16: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Termgewichtung: tf

I Ausweg: ’Glatten’ mittels log

wt,d =

{wenn tft,d > 0 1 + log10 tft,dsonst 0

I Engerer Wertebereich:0 → 0, 1 → 1, 2 → 1.3, 10 → 2, 1000 → 4, etc.

I Aber: Haufige Terme beschreiben ein Dokumentnicht zwingend besser→ Weitere Maße notig

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 17: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Termgewichtung: cf, df

I Korpusfrequenz (cf):Haufigkeit eines Terms im Korpus

I Dokumentenfrequenz (df):Anzahl an Dokumenten, in denen ein Term auftritt

Wort cf df

try 10422 8760insurance 10440 3997

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 18: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Termgewichtung: idf

I Inverse Dokumentenfrequenz (idf):’Informationsgehalt’ eines Terms→ Verteilung uber Korpus

idft = log N

dft

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 19: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispiele fur idf

Berechnung: idft = log Ndft

= log 1,000,000

dft

term dft idftcalpurnia 1

6

animal 100

4

sunday 1000

3

fly 10,000

2

under 100,000

1

the 1,000,000

0

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 20: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispiele fur idf

Berechnung: idft = log Ndft

= log 1,000,000

dft

term dft idftcalpurnia 1 6animal 100 4sunday 1000 3fly 10,000 2under 100,000 1the 1,000,000 0

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 21: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Termgewichtung: tf x idf

wt,d = (1 + log tft,d) · log N

dft

I ’skaliert’ die Termfrequenz: Relation Termhaufigkeit zuInformationsgehalt

I steigt, wenn t in wenig Dokumenten und/oderhaufig innerhalb eines Dokuments auftritt

I ’Overlap Score Measure’ fur Anfragen:

Score(q, d) =∑

t∈q tf-idft,d

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 22: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Gewichtungs-Matrix

Anthony Julius The Hamlet Othello Macbeth . . .and Caesar Tempest

CleopatraAnthony 5.25 3.18 0.0 0.0 0.0 0.35Brutus 1.21 6.10 0.0 1.0 0.0 0.0Caesar 8.59 2.54 0.0 1.51 0.25 0.0Calpurnia 0.0 1.54 0.0 0.0 0.0 0.0Cleopatra 2.85 0.0 0.0 0.0 0.0 0.0mercy 1.51 0.0 1.90 0.12 5.25 0.88worser 1.37 0.0 0.11 4.15 0.25 1.95. . .

Dokumente als reellwertige Vektoren mit tf-idf-Werten ∈ R|V |.

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 23: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Gewichtungs-Matrix

Anthony Julius The Hamlet Othello Macbeth . . .and Caesar Tempest

CleopatraAnthony 5.25 3.18 0.0 0.0 0.0 0.35Brutus 1.21 6.10 0.0 1.0 0.0 0.0Caesar 8.59 2.54 0.0 1.51 0.25 0.0Calpurnia 0.0 1.54 0.0 0.0 0.0 0.0Cleopatra 2.85 0.0 0.0 0.0 0.0 0.0mercy 1.51 0.0 1.90 0.12 5.25 0.88worser 1.37 0.0 0.11 4.15 0.25 1.95. . .

Dokumente als reellwertige Vektoren mit tf-idf-Werten ∈ R|V |.

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 24: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Das Vector Space Model

I hochdimensionaler Vektorraum

I Anzahl der Dimensionen = Große des Vokabulars

Abbildung: www.informationretrieval.org

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 25: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Dokumente als Vektoren

I Dokumente als Punkte im VektorraumI Terme definieren die Achsen des Vektorraums

I Merkmale = TermeI Werte = Gewichte

I Numerische Reprasentation im Vektorraumeroffnet Zugang zu Vergleichsmetriken

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 26: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Anfragen als Vektoren

I Anfragen als “kleine Dokumente“

I Verarbeitung mittels Vektorvergleich→ Rangliste ahnlicher Vektoren

I Moglichkeiten:I DistanzI Winkel

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 27: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Ahnlichkeit als Distanz

I Euklidische Distanz: Differenz zwischen Vektoren

|~q − ~d | =√∑n

i=1(qi − di)2

I Problematisch bei versch. Langen:I Distanz selbst bei ahnlicher Termverteilung sehr groß

I Normalisieren mittels Euklidischer Lange:

|~dj | =√∑n

i=1 d2i ,j

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 28: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Ahnlichkeit als Winkel: Die Cosinus-Ahnlichkeit

cos(~q, ~d) = sim(~q, ~d) =~q · ~d|~q||~d |

=

∑|V |i=1 qidi√∑|V |

i=1 q2i

√∑|V |i=1 d2

i

I qi ist der tf-idf-Wert fur Term i in der Anfrage

I di ist der tf-idf-Wert fur Term i im Dokument

I |~q| und |~d | sind die Langen von ~q und ~d

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 29: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Cosinus fur normalisierte Vektoren

I Cosinus-Ahnlichkeit von ~q und ~d ist aquivalent zum Cosinusdes Winkels zwischen ~q und ~d .

I Bei bereits normalisierten Vektoren entspricht der Cosinusdem Skalarprodukt der Vektoren:

cos(~q, ~d) = ~q · ~d =∑

i qi · di

I ~q und ~d normalisiert mit Euklidischer Lange

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 30: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Cosinus-Ahnlichkeit

Abbildung: www.informationretrieval.org

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 31: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur Cosinus-Ahnlichkeit

I Vergleich der Romane “Sense and Sensibility”, “Pride andPrejudice” und “Wuthering Heights”

Einfache Termfrequenz

Term SaS PaP WH

affection 115 58 20jealous 10 7 11gossip 2 0 6wuthering 0 0 38

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 32: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur Cosinus-Ahnlichkeit

I Vergleich der Romane “Sense and Sensibility”, “Pride andPrejudice” und “Wuthering Heights”

Einfache Termfrequenz

Term SaS PaP WH

affection 115 58 20jealous 10 7 11gossip 2 0 6wuthering 0 0 38

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 33: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur Cosinus

Einfache Termfrequenz

Term SaS PaP WH

affection 115 58 20jealous 10 7 11gossip 2 0 6wuthering 0 0 38

log-tf-Gewichtung

Term SaS PaP WH

affection 3.06 2.76 2.30jealous 2.0 1.85 2.04gossip 1.30 0 1.78wuthering 0 0 2.58

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 34: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur Cosinus

Einfache Termfrequenz

Term SaS PaP WH

affection 115 58 20jealous 10 7 11gossip 2 0 6wuthering 0 0 38

log-tf-Gewichtung

Term SaS PaP WH

affection 3.06 2.76 2.30jealous 2.0 1.85 2.04gossip 1.30 0 1.78wuthering 0 0 2.58

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 35: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur Cosinus

log-tf-Gewichtung

Term SaS PaP WH

affection 3.06 2.76 2.30jealous 2.0 1.85 2.04gossip 1.30 0 1.78wuthering 0 0 2.58

log-tf-Gewichtung& Cosinus-Normalisierung

Term SaS PaP WH

affection 0.789 0.832 0.524jealous 0.515 0.555 0.465gossip 0.335 0.0 0.405wuthering 0.0 0.0 0.588

cos(SaS,PaP) ≈0.789*0.832+0.515*0.555+0.335*0.0+0.0*0.0 ≈ 0.94.cos(SaS,WH) ≈ 0.79cos(PaP,WH) ≈ 0.69Warum ist cos(SaS,PaP) > cos(SAS,WH)?

SaS, PaP: Jane Austen; WH: Emily Bronte

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 36: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur Cosinus

log-tf-Gewichtung

Term SaS PaP WH

affection 3.06 2.76 2.30jealous 2.0 1.85 2.04gossip 1.30 0 1.78wuthering 0 0 2.58

log-tf-Gewichtung& Cosinus-Normalisierung

Term SaS PaP WH

affection 0.789 0.832 0.524jealous 0.515 0.555 0.465gossip 0.335 0.0 0.405wuthering 0.0 0.0 0.588

cos(SaS,PaP) ≈0.789*0.832+0.515*0.555+0.335*0.0+0.0*0.0 ≈ 0.94.cos(SaS,WH) ≈ 0.79cos(PaP,WH) ≈ 0.69Warum ist cos(SaS,PaP) > cos(SAS,WH)?

SaS, PaP: Jane Austen; WH: Emily Bronte

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 37: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur Cosinus

log-tf-Gewichtung

Term SaS PaP WH

affection 3.06 2.76 2.30jealous 2.0 1.85 2.04gossip 1.30 0 1.78wuthering 0 0 2.58

log-tf-Gewichtung& Cosinus-Normalisierung

Term SaS PaP WH

affection 0.789 0.832 0.524jealous 0.515 0.555 0.465gossip 0.335 0.0 0.405wuthering 0.0 0.0 0.588

cos(SaS,PaP) ≈0.789*0.832+0.515*0.555+0.335*0.0+0.0*0.0 ≈ 0.94.

cos(SaS,WH) ≈ 0.79cos(PaP,WH) ≈ 0.69Warum ist cos(SaS,PaP) > cos(SAS,WH)?

SaS, PaP: Jane Austen; WH: Emily Bronte

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 38: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur Cosinus

log-tf-Gewichtung

Term SaS PaP WH

affection 3.06 2.76 2.30jealous 2.0 1.85 2.04gossip 1.30 0 1.78wuthering 0 0 2.58

log-tf-Gewichtung& Cosinus-Normalisierung

Term SaS PaP WH

affection 0.789 0.832 0.524jealous 0.515 0.555 0.465gossip 0.335 0.0 0.405wuthering 0.0 0.0 0.588

cos(SaS,PaP) ≈0.789*0.832+0.515*0.555+0.335*0.0+0.0*0.0 ≈ 0.94.cos(SaS,WH) ≈ 0.79

cos(PaP,WH) ≈ 0.69Warum ist cos(SaS,PaP) > cos(SAS,WH)?

SaS, PaP: Jane Austen; WH: Emily Bronte

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 39: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur Cosinus

log-tf-Gewichtung

Term SaS PaP WH

affection 3.06 2.76 2.30jealous 2.0 1.85 2.04gossip 1.30 0 1.78wuthering 0 0 2.58

log-tf-Gewichtung& Cosinus-Normalisierung

Term SaS PaP WH

affection 0.789 0.832 0.524jealous 0.515 0.555 0.465gossip 0.335 0.0 0.405wuthering 0.0 0.0 0.588

cos(SaS,PaP) ≈0.789*0.832+0.515*0.555+0.335*0.0+0.0*0.0 ≈ 0.94.cos(SaS,WH) ≈ 0.79cos(PaP,WH) ≈ 0.69

Warum ist cos(SaS,PaP) > cos(SAS,WH)?

SaS, PaP: Jane Austen; WH: Emily Bronte

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 40: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur Cosinus

log-tf-Gewichtung

Term SaS PaP WH

affection 3.06 2.76 2.30jealous 2.0 1.85 2.04gossip 1.30 0 1.78wuthering 0 0 2.58

log-tf-Gewichtung& Cosinus-Normalisierung

Term SaS PaP WH

affection 0.789 0.832 0.524jealous 0.515 0.555 0.465gossip 0.335 0.0 0.405wuthering 0.0 0.0 0.588

cos(SaS,PaP) ≈0.789*0.832+0.515*0.555+0.335*0.0+0.0*0.0 ≈ 0.94.cos(SaS,WH) ≈ 0.79cos(PaP,WH) ≈ 0.69Warum ist cos(SaS,PaP) > cos(SAS,WH)?

SaS, PaP: Jane Austen; WH: Emily Bronte

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 41: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur Cosinus

log-tf-Gewichtung

Term SaS PaP WH

affection 3.06 2.76 2.30jealous 2.0 1.85 2.04gossip 1.30 0 1.78wuthering 0 0 2.58

log-tf-Gewichtung& Cosinus-Normalisierung

Term SaS PaP WH

affection 0.789 0.832 0.524jealous 0.515 0.555 0.465gossip 0.335 0.0 0.405wuthering 0.0 0.0 0.588

cos(SaS,PaP) ≈0.789*0.832+0.515*0.555+0.335*0.0+0.0*0.0 ≈ 0.94.cos(SaS,WH) ≈ 0.79cos(PaP,WH) ≈ 0.69Warum ist cos(SaS,PaP) > cos(SAS,WH)?

SaS, PaP: Jane Austen; WH: Emily Bronte

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 42: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Komponenten der tf-idf-Gewichtung

Termfrequenz Dokumentfrequenz Normalisierung

n (natural) tft,d n (no) 1 n (none)1

l (logarithm) 1 + log(tft,d) t (idf) log Ndft

c (cosine)1√

w21 +w2

2 +...+w2M

a (augmented) 0.5 +0.5×tft,d

maxt(tft,d )p (prob idf) max{0, log N−t

t} u (pivoted

unique)1/u

b (boolean)

{1 if t,d > 00 otherwise

b (byte size) 1/CharLengthα,α < 1

L (log ave)1+log(t,d )

1+log(t∈d (t,d ))

I Bekannteste KombinationI Default: Keine Gewichtung

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 43: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Komponenten der tf-idf-Gewichtung

Termfrequenz Dokumentfrequenz Normalisierung

n (natural) tft,d n (no) 1 n (none)1

l (logarithm) 1 + log(tft,d) t (idf) log Ndft

c (cosine)1√

w21 +w2

2 +...+w2M

a (augmented) 0.5 +0.5×tft,d

maxt(tft,d )p (prob idf) max{0, log N−t

t} u (pivoted

unique)1/u

b (boolean)

{1 if t,d > 00 otherwise

b (byte size) 1/CharLengthα,α < 1

L (log ave)1+log(t,d )

1+log(t∈d (t,d ))

I Bekannteste Kombination

I Default: Keine Gewichtung

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 44: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Komponenten der tf-idf-Gewichtung

Termfrequenz Dokumentfrequenz Normalisierung

n (natural) tft,d n (no) 1 n (none)1

l (logarithm) 1 + log(tft,d) t (idf) log Ndft

c (cosine)1√

w21 +w2

2 +...+w2M

a (augmented) 0.5 +0.5×tft,d

maxt(tft,d )p (prob idf) max{0, log N−t

t} u (pivoted

unique)1/u

b (boolean)

{1 if t,d > 00 otherwise

b (byte size) 1/CharLengthα,α < 1

L (log ave)1+log(t,d )

1+log(t∈d (t,d ))

I Bekannteste Kombination

I Default: Keine Gewichtung

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 45: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Komponenten der tf-idf-Gewichtung

I Anfrage und Dokument oftmals unterschiedlich gewichtet

I SMART-Notation: qqq.dddI Beispiel: ltn.lnc

I Anfrage: Logarithmische tf, idf, keine NormalisierungI Dokument: Logarithmische tf, keine idf,

Cosinus-Normalisierung

I Beispiel:I Anfrage: “best car insurance”I Dokument: “car insurance auto insurance”

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 46: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur tf-idf mit der Kombination ltn.lnc

Anfrage: “best car insurance”. Dokument: “car insurance auto insurance”.Wort query document product

tf-raw tf-wght df idf weight tf-raw tf-wght weight n’lized

auto

0 0 5000 2.3 0 1 1 1 0.52 0

best

1 1 50000 1.3 1.3 0 0 0 0 0

car

1 1 10000 2.0 2.0 1 1 1 0.52 1.04

insurance

1 1 1000 3.0 3.0 2 1.3 1.3 0.68 2.04

Key to columns: tf-raw: raw (unweighted) term frequency, tf-wght: logarithmically weightedterm frequency, df: document frequency, idf: inverse document frequency, weight: the finalweight of the term in the query or document, n’lized: document weights after cosinenormalization, product: the product of final query weight and final document weight

√12 + 02 + 12 + 1.32 ≈ 1.92

1/1.92 ≈ 0.521.3/1.92 ≈ 0.68

Score fur Anfrage/Dokument:∑i wqi · wdi = 0 + 0 + 1.04 + 2.04 = 3.08

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 47: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur tf-idf mit der Kombination ltn.lnc

Anfrage: “best car insurance”. Dokument: “car insurance auto insurance”.Wort query document product

tf-raw tf-wght df idf weight tf-raw tf-wght weight n’lized

auto 0

0 5000 2.3 0 1 1 1 0.52 0

best 1

1 50000 1.3 1.3 0 0 0 0 0

car 1

1 10000 2.0 2.0 1 1 1 0.52 1.04

insurance 1

1 1000 3.0 3.0 2 1.3 1.3 0.68 2.04

Key to columns: tf-raw: raw (unweighted) term frequency, tf-wght: logarithmically weightedterm frequency, df: document frequency, idf: inverse document frequency, weight: the finalweight of the term in the query or document, n’lized: document weights after cosinenormalization, product: the product of final query weight and final document weight

√12 + 02 + 12 + 1.32 ≈ 1.92

1/1.92 ≈ 0.521.3/1.92 ≈ 0.68

Score fur Anfrage/Dokument:∑i wqi · wdi = 0 + 0 + 1.04 + 2.04 = 3.08

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 48: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur tf-idf mit der Kombination ltn.lnc

Anfrage: “best car insurance”. Dokument: “car insurance auto insurance”.Wort query document product

tf-raw tf-wght df idf weight tf-raw tf-wght weight n’lized

auto 0

0 5000 2.3 0

1

1 1 0.52 0

best 1

1 50000 1.3 1.3

0

0 0 0 0

car 1

1 10000 2.0 2.0

1

1 1 0.52 1.04

insurance 1

1 1000 3.0 3.0

2

1.3 1.3 0.68 2.04

Key to columns: tf-raw: raw (unweighted) term frequency, tf-wght: logarithmically weightedterm frequency, df: document frequency, idf: inverse document frequency, weight: the finalweight of the term in the query or document, n’lized: document weights after cosinenormalization, product: the product of final query weight and final document weight

√12 + 02 + 12 + 1.32 ≈ 1.92

1/1.92 ≈ 0.521.3/1.92 ≈ 0.68

Score fur Anfrage/Dokument:∑i wqi · wdi = 0 + 0 + 1.04 + 2.04 = 3.08

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 49: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur tf-idf mit der Kombination ltn.lnc

Anfrage: “best car insurance”. Dokument: “car insurance auto insurance”.Wort query document product

tf-raw tf-wght df idf weight tf-raw tf-wght weight n’lized

auto 0 0

5000 2.3 0

1

1 1 0.52 0

best 1 1

50000 1.3 1.3

0

0 0 0 0

car 1 1

10000 2.0 2.0

1

1 1 0.52 1.04

insurance 1 1

1000 3.0 3.0

2

1.3 1.3 0.68 2.04

Key to columns: tf-raw: raw (unweighted) term frequency, tf-wght: logarithmically weightedterm frequency, df: document frequency, idf: inverse document frequency, weight: the finalweight of the term in the query or document, n’lized: document weights after cosinenormalization, product: the product of final query weight and final document weight

√12 + 02 + 12 + 1.32 ≈ 1.92

1/1.92 ≈ 0.521.3/1.92 ≈ 0.68

Score fur Anfrage/Dokument:∑i wqi · wdi = 0 + 0 + 1.04 + 2.04 = 3.08

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 50: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur tf-idf mit der Kombination ltn.lnc

Anfrage: “best car insurance”. Dokument: “car insurance auto insurance”.Wort query document product

tf-raw tf-wght df idf weight tf-raw tf-wght weight n’lized

auto 0 0

5000 2.3 0

1 1

1 0.52 0

best 1 1

50000 1.3 1.3

0 0

0 0 0

car 1 1

10000 2.0 2.0

1 1

1 0.52 1.04

insurance 1 1

1000 3.0 3.0

2 1.3

1.3 0.68 2.04

Key to columns: tf-raw: raw (unweighted) term frequency, tf-wght: logarithmically weightedterm frequency, df: document frequency, idf: inverse document frequency, weight: the finalweight of the term in the query or document, n’lized: document weights after cosinenormalization, product: the product of final query weight and final document weight

√12 + 02 + 12 + 1.32 ≈ 1.92

1/1.92 ≈ 0.521.3/1.92 ≈ 0.68

Score fur Anfrage/Dokument:∑i wqi · wdi = 0 + 0 + 1.04 + 2.04 = 3.08

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 51: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur tf-idf mit der Kombination ltn.lnc

Anfrage: “best car insurance”. Dokument: “car insurance auto insurance”.Wort query document product

tf-raw tf-wght df idf weight tf-raw tf-wght weight n’lized

auto 0 0 5000

2.3 0

1 1

1 0.52 0

best 1 1 50000

1.3 1.3

0 0

0 0 0

car 1 1 10000

2.0 2.0

1 1

1 0.52 1.04

insurance 1 1 1000

3.0 3.0

2 1.3

1.3 0.68 2.04

Key to columns: tf-raw: raw (unweighted) term frequency, tf-wght: logarithmically weightedterm frequency, df: document frequency, idf: inverse document frequency, weight: the finalweight of the term in the query or document, n’lized: document weights after cosinenormalization, product: the product of final query weight and final document weight

√12 + 02 + 12 + 1.32 ≈ 1.92

1/1.92 ≈ 0.521.3/1.92 ≈ 0.68

Score fur Anfrage/Dokument:∑i wqi · wdi = 0 + 0 + 1.04 + 2.04 = 3.08

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 52: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur tf-idf mit der Kombination ltn.lnc

Anfrage: “best car insurance”. Dokument: “car insurance auto insurance”.Wort query document product

tf-raw tf-wght df idf weight tf-raw tf-wght weight n’lized

auto 0 0 5000 2.3

0

1 1

1 0.52 0

best 1 1 50000 1.3

1.3

0 0

0 0 0

car 1 1 10000 2.0

2.0

1 1

1 0.52 1.04

insurance 1 1 1000 3.0

3.0

2 1.3

1.3 0.68 2.04

Key to columns: tf-raw: raw (unweighted) term frequency, tf-wght: logarithmically weightedterm frequency, df: document frequency, idf: inverse document frequency, weight: the finalweight of the term in the query or document, n’lized: document weights after cosinenormalization, product: the product of final query weight and final document weight

√12 + 02 + 12 + 1.32 ≈ 1.92

1/1.92 ≈ 0.521.3/1.92 ≈ 0.68

Score fur Anfrage/Dokument:∑i wqi · wdi = 0 + 0 + 1.04 + 2.04 = 3.08

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 53: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur tf-idf mit der Kombination ltn.lnc

Anfrage: “best car insurance”. Dokument: “car insurance auto insurance”.Wort query document product

tf-raw tf-wght df idf weight tf-raw tf-wght weight n’lized

auto 0 0 5000 2.3 0 1 1

1 0.52 0

best 1 1 50000 1.3 1.3 0 0

0 0 0

car 1 1 10000 2.0 2.0 1 1

1 0.52 1.04

insurance 1 1 1000 3.0 3.0 2 1.3

1.3 0.68 2.04

Key to columns: tf-raw: raw (unweighted) term frequency, tf-wght: logarithmically weightedterm frequency, df: document frequency, idf: inverse document frequency, weight: the finalweight of the term in the query or document, n’lized: document weights after cosinenormalization, product: the product of final query weight and final document weight

√12 + 02 + 12 + 1.32 ≈ 1.92

1/1.92 ≈ 0.521.3/1.92 ≈ 0.68

Score fur Anfrage/Dokument:∑i wqi · wdi = 0 + 0 + 1.04 + 2.04 = 3.08

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 54: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur tf-idf mit der Kombination ltn.lnc

Anfrage: “best car insurance”. Dokument: “car insurance auto insurance”.Wort query document product

tf-raw tf-wght df idf weight tf-raw tf-wght weight n’lized

auto 0 0 5000 2.3 0 1 1

1 0.52 0

best 1 1 50000 1.3 1.3 0 0

0 0 0

car 1 1 10000 2.0 2.0 1 1

1 0.52 1.04

insurance 1 1 1000 3.0 3.0 2 1.3

1.3 0.68 2.04

Key to columns: tf-raw: raw (unweighted) term frequency, tf-wght: logarithmically weightedterm frequency, df: document frequency, idf: inverse document frequency, weight: the finalweight of the term in the query or document, n’lized: document weights after cosinenormalization, product: the product of final query weight and final document weight

√12 + 02 + 12 + 1.32 ≈ 1.92

1/1.92 ≈ 0.521.3/1.92 ≈ 0.68

Score fur Anfrage/Dokument:∑i wqi · wdi = 0 + 0 + 1.04 + 2.04 = 3.08

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 55: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur tf-idf mit der Kombination ltn.lnc

Anfrage: “best car insurance”. Dokument: “car insurance auto insurance”.Wort query document product

tf-raw tf-wght df idf weight tf-raw tf-wght weight n’lized

auto 0 0 5000 2.3 0 1 1 1

0.52 0

best 1 1 50000 1.3 1.3 0 0 0

0 0

car 1 1 10000 2.0 2.0 1 1 1

0.52 1.04

insurance 1 1 1000 3.0 3.0 2 1.3 1.3

0.68 2.04

Key to columns: tf-raw: raw (unweighted) term frequency, tf-wght: logarithmically weightedterm frequency, df: document frequency, idf: inverse document frequency, weight: the finalweight of the term in the query or document, n’lized: document weights after cosinenormalization, product: the product of final query weight and final document weight

√12 + 02 + 12 + 1.32 ≈ 1.92

1/1.92 ≈ 0.521.3/1.92 ≈ 0.68

Score fur Anfrage/Dokument:∑i wqi · wdi = 0 + 0 + 1.04 + 2.04 = 3.08

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 56: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur tf-idf mit der Kombination ltn.lnc

Anfrage: “best car insurance”. Dokument: “car insurance auto insurance”.Wort query document product

tf-raw tf-wght df idf weight tf-raw tf-wght weight n’lized

auto 0 0 5000 2.3 0 1 1 1 0.52

0

best 1 1 50000 1.3 1.3 0 0 0 0

0

car 1 1 10000 2.0 2.0 1 1 1 0.52

1.04

insurance 1 1 1000 3.0 3.0 2 1.3 1.3 0.68

2.04

Key to columns: tf-raw: raw (unweighted) term frequency, tf-wght: logarithmically weightedterm frequency, df: document frequency, idf: inverse document frequency, weight: the finalweight of the term in the query or document, n’lized: document weights after cosinenormalization, product: the product of final query weight and final document weight√

12 + 02 + 12 + 1.32 ≈ 1.921/1.92 ≈ 0.521.3/1.92 ≈ 0.68

Score fur Anfrage/Dokument:∑i wqi · wdi = 0 + 0 + 1.04 + 2.04 = 3.08

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 57: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur tf-idf mit der Kombination ltn.lnc

Anfrage: “best car insurance”. Dokument: “car insurance auto insurance”.Wort query document product

tf-raw tf-wght df idf weight tf-raw tf-wght weight n’lized

auto 0 0 5000 2.3 0 1 1 1 0.52 0best 1 1 50000 1.3 1.3 0 0 0 0 0car 1 1 10000 2.0 2.0 1 1 1 0.52 1.04insurance 1 1 1000 3.0 3.0 2 1.3 1.3 0.68 2.04

Key to columns: tf-raw: raw (unweighted) term frequency, tf-wght: logarithmically weightedterm frequency, df: document frequency, idf: inverse document frequency, weight: the finalweight of the term in the query or document, n’lized: document weights after cosinenormalization, product: the product of final query weight and final document weight

√12 + 02 + 12 + 1.32 ≈ 1.92

1/1.92 ≈ 0.521.3/1.92 ≈ 0.68

Score fur Anfrage/Dokument:∑i wqi · wdi = 0 + 0 + 1.04 + 2.04 = 3.08

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 58: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Beispielberechnung fur tf-idf mit der Kombination ltn.lnc

Anfrage: “best car insurance”. Dokument: “car insurance auto insurance”.Wort query document product

tf-raw tf-wght df idf weight tf-raw tf-wght weight n’lized

auto 0 0 5000 2.3 0 1 1 1 0.52 0best 1 1 50000 1.3 1.3 0 0 0 0 0car 1 1 10000 2.0 2.0 1 1 1 0.52 1.04insurance 1 1 1000 3.0 3.0 2 1.3 1.3 0.68 2.04

Key to columns: tf-raw: raw (unweighted) term frequency, tf-wght: logarithmically weightedterm frequency, df: document frequency, idf: inverse document frequency, weight: the finalweight of the term in the query or document, n’lized: document weights after cosinenormalization, product: the product of final query weight and final document weight

√12 + 02 + 12 + 1.32 ≈ 1.92

1/1.92 ≈ 0.521.3/1.92 ≈ 0.68

Score fur Anfrage/Dokument:∑i wqi · wdi = 0 + 0 + 1.04 + 2.04 = 3.08

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 59: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Zusammenfassung: Das Vector Space Model

I Vorteile:I Kompakte Darstellung der Eigenschaften von DokumentenI Numerische ReprasentationI Vergleichsmetriken liefern graduelle Ahnlichkeiten→ Ranking der Dokumente relativ zur Anfrage

I Probleme:I ’Bag of words’I Wildcards / unscharfes MatchenI Dimensionalitat / SparsenessI Polysemie / Homonymie

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 60: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

VSM vs. Boolesches Modell

I VSM:I Akkumulierte Evidenz: Termfrequenz erhoht BewertungI Nur fur Freitext-Anfragen geeignet

I Boolesches Modell:I Selektive EvidenzI Wahr, wenn Gewicht ≥ 0

I Kombination:I implizites UNDI Weitere Operatoren fur verfeinerte Anfragen

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 61: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

VSM und Wildcards

I Keine direkte Abfrage moglich

I Indexstrukturen nicht kompatibel (Matrix/Baum)I Kombinierbar mittels k-gram-Index und ’Query expansion’:

I Aus k-gram-Index passende Terme holenI Daraus Anfragen-Vektor konstruieren

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 62: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

VSM und Phrase Queries

I VSM nicht fur Positionsabhangige Suche geeignetI Bei Mehrwort-Anfragen werden immer auch die Achsen der

einzelnen Terme aktiviertI Kombinierbar mittels ’Query Parsing’

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 63: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Wie geht es weiter?

I Evaluation (IIR 8)

I Web-Retrieval (IIR 19-21)

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln

Page 64: Information-Retrieval: Vektorraum-Modell · 03. Dezember 2009 Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universit at zu K

Parameter und Bereiche Gewichtung Vektorraum-Modell VSM vs. Boole Literatur

Luhn, H. P. (1957).A statistical approach to mechanized encoding and searchingof literary information.IBM Journal of Research and Development, 1(4):309–317.

Manning, C. D., Raghavan, P., and Schutze, H. (2008).Introduction to Information Retrieval.Cambridge University Press.

Zum Nachlesen: [Manning et al., 2008], Kapitel 6(siehe www.informationretrieval.org)

Text-Engineering I - Information-Retrieval - Wintersemester 2009/2010 - Informationsverarbeitung - Universitat zu Koln