We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Term Frequency

Now that we can find documents that contain our search terms, let's measure how often each term appears.

Term frequency (TF) measures how often a word occurs in a document. For example:

Boots teaches students programming while enjoying his salmon for lunch. The students gather round as they learn debugging techniques, and all students leave with new coding skills.

Term frequencies:

  • students appears 3 times
  • salmon appears 1 time

This is a signal that students is probably more important than salmon in this document.

Early internet search engines (pre-Google) used term frequency heavily. Sites could game the rankings by repeating keywords over and over: keyword stuffing. Modern search engines use more advanced signals.

Assignment

Run and submit the CLI tests.