Inferensys

Glossary

TF-ICF

A weighting scheme that adapts TF-IDF by replacing the inverse document frequency with inverse corpus frequency to measure domain specificity.
Developer working on RAG retrieval system, document chunks visible on screen, technical workspace with code editor.
TERM FREQUENCY-INVERSE CORPUS FREQUENCY

What is TF-ICF?

TF-ICF is a statistical weighting scheme that adapts the classic TF-IDF metric by replacing the inverse document frequency component with inverse corpus frequency to measure a term's domain specificity rather than its general rarity.

TF-ICF (Term Frequency-Inverse Corpus Frequency) is a weighting algorithm designed to quantify how uniquely representative a term is of a specific domain corpus compared to a general reference corpus. While TF-IDF penalizes terms that appear in many documents within a single collection, TF-ICF penalizes terms that are common across multiple distinct corpora, effectively surfacing phrases that are characteristic of a particular domain's jargon or specialized vocabulary.

The computation multiplies the raw term frequency (TF) in a target document by the logarithmically scaled inverse of the term's frequency across a set of disparate corpora. A term that appears frequently in a medical corpus but rarely in legal or financial corpora receives a high TF-ICF weight, marking it as a domain-discriminative keyphrase. This makes TF-ICF particularly valuable for cross-domain keyphrase extraction and building domain-specific glossaries where general-purpose IDF scores would incorrectly suppress essential technical terminology.

WEIGHTING SCHEME COMPARISON

TF-ICF vs. TF-IDF

A technical comparison of Term Frequency-Inverse Corpus Frequency against the classic Term Frequency-Inverse Document Frequency weighting scheme for domain-specific keyphrase extraction.

FeatureTF-IDFTF-ICF

Core Formula

TF × log(N / df)

TF × log(|C| / cf)

Frequency Denominator

Inverse Document Frequency (IDF)

Inverse Corpus Frequency (ICF)

Scope of Analysis

Single document collection

Multiple domain corpora

Domain Specificity

Penalizes Common Corpus Terms

Cross-Domain Comparison

Computational Complexity

O(N) per term

O(|C|) per term

Use Case

General information retrieval

Domain-specific keyphrase extraction

Domain-Specific Weighting

Key Characteristics of TF-ICF

TF-ICF refines the classic TF-IDF model by shifting the focus from general rarity to domain specificity. It measures a term's importance within a specific corpus, making it ideal for distinguishing jargon in specialized fields.

01

Corpus Frequency Substitution

The core innovation of TF-ICF is replacing the global Inverse Document Frequency (IDF) with Inverse Corpus Frequency (ICF). While IDF penalizes terms that appear in many documents across a general collection, ICF penalizes terms that are common across related corpora. This highlights terms that are uniquely important to a specific domain rather than just globally rare words.

02

Domain Specificity Scoring

TF-ICF excels at surfacing domain-specific jargon. A term like 'vector' might have a low IDF score because it appears in physics, biology, and math documents. However, its ICF score would be high within a corpus of NLP papers because it is highly characteristic of that specific field compared to other scientific domains. This makes it superior for building domain-aware search engines.

03

Mathematical Formulation

The weight is calculated as: TF-ICF(t, d, C) = TF(t, d) × ICF(t) Where:

  • TF(t, d): Frequency of term t in document d.
  • ICF(t): Logarithmically scaled inverse of the frequency of t across a set of distinct corpora. This formula ensures that a term must be both frequent in the document and uniquely characteristic of the target corpus to receive a high score.
04

Corpus-Level Comparison

Unlike TF-IDF, which operates on a single document collection, TF-ICF requires a multi-corpus setup. The ICF factor is calculated by comparing the frequency of a term in a target corpus against its frequency in a background or contrastive corpus. This contrastive analysis is what allows the algorithm to isolate terms that define the target domain.

05

Application in Keyphrase Extraction

In keyphrase extraction, TF-ICF is used to filter out generic academic or business language and retain domain-critical phrases. For example, in a corpus of medical texts, TF-ICF will down-weight common words like 'patient' or 'study' (which appear across many medical subfields) and up-weight highly specific terms like 'myocardial infarction' if they are distinct to a cardiology corpus.

06

Comparison with TF-IDF

The key distinction lies in the scope of 'rarity':

  • TF-IDF: Measures how rare a term is within a single collection of documents.
  • TF-ICF: Measures how rare a term is across multiple distinct collections. This makes TF-ICF robust against common-but-important terms that IDF might incorrectly penalize, providing a more nuanced view of topical relevance.
TF-ICF EXPLAINED

Frequently Asked Questions

Clear answers to common questions about Term Frequency-Inverse Corpus Frequency, a weighting scheme that adapts TF-IDF to measure domain specificity rather than general rarity.

TF-ICF (Term Frequency-Inverse Corpus Frequency) is a statistical weighting scheme that measures how specific a term is to a particular domain corpus rather than to a general background corpus. It works by multiplying two components: Term Frequency (TF), which counts how often a word appears in a single document, and Inverse Corpus Frequency (ICF), which penalizes words that are common across multiple domain-specific corpora. Unlike TF-IDF, which uses a single universal corpus to calculate inverse document frequency, TF-ICF compares the frequency of a term in a focused domain corpus against its frequency across multiple other domain corpora. The formula is: TF-ICF(t,d) = TF(t,d) × log(N_c / CF(t)), where N_c is the total number of corpora and CF(t) is the number of corpora containing term t. This makes TF-ICF particularly effective for identifying domain-specific terminology that distinguishes one field from another.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.