AI Glossary / Natural language and speech / Intermediate

Term weight

Definition

A term weight is a numerical value assigned to a term in a text representation or retrieval model to control its contribution to a score. It may reflect how often the term occurs, how broadly it appears across a collection, or other model-specific factors. A term weight is not automatically a probability or a universal measure of a word’s importance.

What it means

A search system often needs more detail than whether a query word appears somewhere in a document. Weighting lets different occurrences or terms contribute differently to the representation used for matching.
A term repeated in one document may be a useful clue, while a term present in almost every document may do little to distinguish among them. The weighting rule expresses how the model balances such evidence.
The word term refers to the indexing unit after the system’s text processing. It can differ from an unprocessed written word because tokenization, normalization, or phrase handling may affect the vocabulary.

How it works

Define the vocabulary and calculate the statistics needed by the weighting scheme. A simple term-frequency weight uses the number of occurrences of a term in a document.
A tf - idf scheme combines a document-level frequency component with an inverse-document-frequency component that reflects how many documents contain the term. Other schemes may transform counts, normalize document vectors, or use different scoring assumptions.
Use the weights in the intended matching or classification calculation. Their numerical meaning depends on that formula, including any normalization and treatment of absent terms.
Evaluate the resulting rankings or predictions on representative tasks. A larger weight means a stronger contribution under the chosen rule, not necessarily greater factual importance, truth, or relevance for every possible query.

Three practical examples

  • A document search model gives a distinctive technical term more influence than a term appearing throughout the collection.
  • A text classifier uses weighted term features rather than only recording whether each word appears.
  • An analyst inspects document vectors to understand which terms contribute strongly under a specified weighting formula.

Think of it this way

Think of assigning different volumes to signals before combining them. Some signals contribute more strongly to the final result under the chosen settings. The analogy is limited because a high term weight is a mathematical contribution, not proof that the word is meaningful to every reader or that the document is a good answer.

Worked example

Use an invented collection of 100 documents and the explicitly defined weight tf × log10(N/df), with raw term count tf, total document count N, and document frequency df. Ignore additional normalization for this exercise.
The term “calibration” appears three times in one document and occurs in ten documents overall. Its inverse document frequency is log10(100/10) = 1, so its weight in that document is 3 × 1 = 3.
The term “equipment” appears eight times in the same document but occurs in all 100 documents. Its inverse document frequency is log10(100/100) = 0, giving weight 8 × 0 = 0 under this particular formula.
This does not mean equipment is meaningless. It means the term does not distinguish documents through this collection-level factor. A smoothed formula or another retrieval model could assign a different value. The example demonstrates why weights must be interpreted with their formula and collection context.

Illustrative case study

In a fictional project, Harbor Manuals builds a search index for technical documentation. A dashboard labels the highest-weighted terms as the document’s “most important facts,” even though the weights were calculated only for retrieval.
The team changes the description to explain the scoring scheme and tests whether the terms help retrieve relevant manuals. Reviewers also inspect rare typographical errors that receive high weights because they appear in very few documents.
The imagined review separates distinctiveness from factual importance. It does not claim that rare terms are always useful or that a weighting scheme understands the meaning of a document merely by counting occurrences.

Common misconceptions and mistakes

Term weight is not synonymous with raw frequency; raw frequency is one possible component or scheme.
A high weight is not a calibrated probability of relevance.
Document frequency counts documents containing the term, not every occurrence across the collection.
Finally, a zero weight under one formula does not mean a word can be removed harmlessly from every task. Phrase interpretation and grammatical meaning may still depend on it.

Business use

Term weighting supports search ranking, text classification, similarity analysis, and interpretable baseline models. It offers a transparent way to connect corpus statistics with a model’s scoring behavior.
Document the formula, preprocessing, collection, and normalization. Changing the collection can change inverse-document-frequency values even when a particular document remains unchanged.
Test actual user queries and downstream outcomes rather than judging the weights in isolation. An index can assign mathematically correct weights and still retrieve poor results because of ambiguous vocabulary, missing context, or an unsuitable scoring design. Weight inspection is a diagnostic aid, not a complete quality assessment.

People also ask

Is a term weight always between zero and one?

No. Its range depends on the weighting scheme.

Can the same word have different weights in different documents?

Yes, because document-level frequency or other factors can differ.

Does changing the collection affect weights?

It can. Schemes using document frequency depend on collection statistics.

Check your understanding

Under raw tf × log10(N/df), a term occurs twice in a document and in 10 of 1,000 documents. What is its weight?

Answer: 2 × log10(100) = 2 × 2 = 4, before any additional normalization.

Related terms

  • Information retrieval
  • Normalization
  • term frequency
  • inverse document frequency
  • tf–idf
  • document frequency
  • vector space model
  • relevance score

Learn next

Compare binary presence, raw frequency, and tf - idf on the same small collection. Then examine how document-length normalization changes similarity and why a term’s score contribution differs from a human judgment of importance.

  • Normalization

More in Natural language and speech

  • Temporal anchor - A temporal anchor is a reference time used to interpret a time expression or locate an event.
  • Temporal annotation - Temporal annotation is the addition of structured labels describing time-related information in language.
  • Temporal expressions - Temporal expressions are words, numbers or phrases that refer to time.
  • Terminal symbol - A terminal symbol is a symbol that appears in the completed strings generated by a formal grammar.
  • Text corpus - A text corpus is an organized collection of texts assembled for a defined purpose, such as studying language, training a model or evaluating a...
  • Text graph - A text graph is a graph representation built from language material.

Sources

Sources: Manning, Raghavan, and Schütze, Introduction to Information Retrieval, term weighting: https://nlp.stanford.edu/IR-book/html/htmledition/term-frequency-and-weighting-1.html ; tf–idf: https://nlp.stanford.edu/IR-book/html/htmledition/tf-idf-weighting-1.html ; inverse document frequency: https://nlp.stanford.edu/IR-book/html/htmledition/inverse-document-frequency-1.html . Independently consulted the authors’ definitions of raw term frequency, document frequency, inverse document frequency and the multiplicative tf–idf weighting rule.

Previous: Term partitioning Next: Terminal states

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer