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.
Glossary
TF-ICF

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.
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.
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.
| Feature | TF-IDF | TF-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 |
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.
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.
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.
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.
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.
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.
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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
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.
Related Terms
TF-ICF is a domain-adaptive weighting scheme. The following concepts define the broader landscape of statistical, graph-based, and neural approaches to keyphrase extraction.
TF-IDF
The foundational statistical measure that TF-ICF adapts. It evaluates a word's importance by balancing Term Frequency (how often a word appears in a document) against Inverse Document Frequency (how rare it is across a general corpus).
- Formula:
TF * log(N / df) - Weakness: Penalizes domain-specific terms that appear frequently within a specialized corpus.
- Use Case: General-purpose information retrieval and document similarity.
RAKE
An unsupervised, domain-independent algorithm that extracts keyphrases by analyzing word co-occurrence within stopword-delimited sequences.
- Mechanism: Builds a co-occurrence matrix and scores candidate phrases by summing the degree/frequency ratios of constituent words.
- Strength: Extremely fast; requires no training data or external corpora.
- Limitation: Struggles with multi-word phrases containing internal stopwords.
YAKE
A lightweight unsupervised method that relies on statistical text features extracted from a single document without external corpora.
- Features: Casing, word position, term frequency, context relatedness, and sentence frequency.
- Advantage: Language-agnostic and corpus-independent.
- Scoring: Final score is a product of individual feature scores, with candidates ranked in ascending order.
TextRank
A graph-based ranking algorithm that builds a word or phrase co-occurrence network and applies PageRank to identify salient keyphrases.
- Graph Construction: Vertices are candidate words; edges connect words that co-occur within a window of N tokens.
- Convergence: Iteratively updates vertex scores until convergence below a threshold.
- Post-processing: Top-ranked words are merged into multi-word phrases if they appear adjacent in text.
KeyBERT
A method leveraging BERT embeddings to extract keywords most similar to a document's overall semantic representation.
- Process: Encodes the document and candidate n-grams into a shared embedding space, then computes cosine similarity.
- Variants: Supports Max Sum Similarity and Maximal Marginal Relevance for diversity.
- Advantage: Captures semantic meaning beyond exact string matching.
Maximal Marginal Relevance
A re-ranking algorithm that balances a phrase's relevance to the document against its redundancy with already selected keyphrases.
- Parameter λ: Controls the relevance-diversity trade-off (0 = maximum diversity, 1 = maximum relevance).
- Application: Applied as a post-processing step to KeyBERT and other embedding-based extractors.
- Goal: Produces a keyphrase set that is both representative and non-redundant.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us