document query terms df idf tf log tf d d' tf log tf q q' bad 1000 good 10000 instructor 10 student 50000 The idf values for bad, good, instructor and student are 4, 3, 6, 2.3 respectively. = <2, 2, 1, 1>. |= <1.3, 1.3, 1, 1>. d' = <0.56, 0.56, 0.43, 0.43>. d' = <0.43, 0.43, 0.21, 0.21>. q <0, 1, 0, 1>. q <0, 3, 0, 2.3>. q' <0, 0.79, 0, 0.61>. q' <0, 0.61, 0, 0.43>. cosine(d, q) = 0.705. cosine(d, q) = 0.353.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Let the document be “good bad student good bad instructor” and the query be “good student”. Fill out the empty columns in the following table and then compute the cosine similarity between the document vector and the query vector. In the table, df denotes document frequency, idf denotes inverse document frequency (i.e., idft = log10N/dft), tf denotes term frequency, log tf denotes the tf weight based on log-frequency weighting as shown in slides (i.e., 1+log10tft,d for tft,d> 0 and 0 otherwise), d is the document vector, d’ is the length-normalized d, q is the query vector, and q’ is the length-normalized q. Assume N (number of documents in the corpus) = 10,000,000.

document
query
terms
df
idf
tf
log tf
d
d'
tf
log tf q
q'
bad
1000
good 10000
instructor 10
student 50000
The idf values for bad, good, instructor and student are 4, 3, 6, 2.3 respectively.
= <2, 2, 1, 1>.
|= <1.3, 1.3, 1, 1>.
d' = <0.56, 0.56, 0.43, 0.43>.
d' = <0.43, 0.43, 0.21, 0.21>.
q <0, 1, 0, 1>.
q <0, 3, 0, 2.3>.
q' <0, 0.79, 0, 0.61>.
q' <0, 0.61, 0, 0.43>.
cosine(d, q) = 0.705.
cosine(d, q) = 0.353.
Transcribed Image Text:document query terms df idf tf log tf d d' tf log tf q q' bad 1000 good 10000 instructor 10 student 50000 The idf values for bad, good, instructor and student are 4, 3, 6, 2.3 respectively. = <2, 2, 1, 1>. |= <1.3, 1.3, 1, 1>. d' = <0.56, 0.56, 0.43, 0.43>. d' = <0.43, 0.43, 0.21, 0.21>. q <0, 1, 0, 1>. q <0, 3, 0, 2.3>. q' <0, 0.79, 0, 0.61>. q' <0, 0.61, 0, 0.43>. cosine(d, q) = 0.705. cosine(d, q) = 0.353.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 1 steps

Blurred answer
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education