All books

Professional

Apps About Coach Log in Start reading

Computer Science · Glossary

What is Term frequency, document frequency, tf–idf score?

Also known as: term frequency · document frequency · tf--idf score

Definition 30.3 University Computer Science — Year 1 · Chapter 30 — Project: A Search Engine for a Folder of Texts

In a collection of NN documents, the term frequency tf(t,d)\mathrm{tf}(t, d) of a word tt in a document dd is the number of times tt occurs in dd, and its document frequency df(t)\mathrm{df}(t) is the number of documents that contain it. The tf–idf score of a document dd for a query of words t1,…,tkt_1, \dots, t_k is

score(d)=∑i=1ktf(ti,d)⋅ln⁡Ndf(ti).\mathrm{score}(d) = \sum_{i=1}^{k} \mathrm{tf}(t_i, d) \cdot \ln \frac{N}{\mathrm{df}(t_i)} .
Read in context →