Term Frequency
Also Term Frequencies · tf
The term frequency tf(w, D) is the number of times word w occurs in document D; it is the first, naive score of the posting of D in the inverted list of w.
Know these firstInverted Index
Formula#
With tf scores, the score of document for a keyword query is the sum of the posting scores, computed while merging the inverted lists:
In the Vector Space Model with the tf term-document matrix () and the 0/1 query vector , this is for all documents at once.
Properties#
- ; only non-zero tf values are stored (one posting each).
- Construction: appending the document ID once per occurrence of (as in the Lecture 1 code) already encodes tf implicitly: is the number of times the ID appears in the list. Counting them gives the postings in the same linear pass (DBIS_VL02 > Implementation advice).
- Summing over all documents gives the total frequency of in the collection, the of Zipf’s Law.
- Problems of tf as a score (DBIS_VL02 > Scores: tf, df, idf):
Example#
Sources#
- Slides 02, p. 11, Slides 02, p. 18
- Slides 11, p. 6, Slides 11, p. 8
- DBIS_VL01 > Inverted Index (record ID + count as alternative posting), DBIS_VL02 > Scores: tf, df, idf, DBIS_VL11 > Retrieval as a matrix-vector product
- Exams: DBIS Exam WS2324 (not published) Task 1.1