F1@K is an evaluation metric for keyphrase extraction that computes the harmonic mean of precision@K and recall@K. It measures how well a model identifies relevant keyphrases within its top-K highest-scoring predictions against a gold-standard reference set, penalizing both missed keyphrases and irrelevant predictions in the truncated list.
Glossary
F1@K

What is F1@K?
F1@K is the harmonic mean of precision and recall calculated over the top-K predicted keyphrases, providing a balanced measure of a model's ranking quality for a fixed cutoff.
Unlike mean reciprocal rank, F1@K evaluates the entire top-K set rather than just the first correct hit. It is widely used in benchmarks like KP20k and is particularly relevant for supervised keyphrase extraction systems where a fixed number of keyphrases must be presented to users or downstream indexing pipelines.
Key Characteristics of F1@K
F1@K is the standard metric for evaluating keyphrase extraction systems when only the top-K predictions matter. It balances precision and recall in a single, interpretable score.
Harmonic Mean of Precision@K and Recall@K
F1@K is defined as the harmonic mean of Precision@K and Recall@K. It penalizes systems that achieve high precision by predicting very few phrases or high recall by predicting many irrelevant ones. The formula is:
F1@K = 2 * (Precision@K * Recall@K) / (Precision@K + Recall@K)This ensures a single, balanced score where the worst-performing metric drags down the overall result.
Top-K Truncation Logic
The evaluation only considers the first K predicted keyphrases from an ordered list, typically where K=5, 10, or 15. This mirrors real-world applications where only a limited number of tags are displayed to a user. Predictions beyond rank K are ignored entirely, making the ranking quality of the top candidates critically important.
Micro vs. Macro Averaging
When evaluating across a corpus, F1@K can be computed in two ways:
- Micro-averaging: Aggregates all true positives, false positives, and false negatives globally before computing the F1 score. It weights each prediction equally.
- Macro-averaging: Computes the F1@K for each document independently and then averages the scores. It weights each document equally, regardless of its length.
Stemming and Partial Matching
Strict exact-match evaluation can unfairly penalize a system. Common mitigations include:
- Porter Stemming: Reducing words to their root form (e.g., 'connecting' to 'connect') before comparison.
- Partial Match: Awarding credit if the predicted phrase contains the gold-standard phrase, or vice-versa. This is often used for longer, multi-word keyphrases.
Limitations and Sensitivity
F1@K is highly sensitive to the choice of K. A system optimized for K=5 may perform poorly at K=20. It also does not differentiate between a highly salient keyphrase and a marginally relevant one—all matches are binary. This has led to the use of complementary metrics like Mean Average Precision (MAP) or NDCG for ranked quality assessment.
Frequently Asked Questions
Clear answers to common questions about the F1@K evaluation metric, its calculation, and its role in benchmarking keyphrase extraction systems.
F1@K is an evaluation metric that computes the harmonic mean of precision and recall considering only the top-K predicted keyphrases against a gold-standard set. It is calculated by first taking the top K predictions from a model's ranked output, computing precision@K (the fraction of those top K that are correct) and recall@K (the fraction of all gold-standard keyphrases captured within those top K), and then applying the standard F1 formula: 2 * (Precision@K * Recall@K) / (Precision@K + Recall@K). This provides a single balanced score that penalizes systems for both missing relevant keyphrases and including irrelevant ones within the cutoff.
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.
Related Terms
Essential evaluation metrics and related concepts for benchmarking keyphrase extraction systems against gold-standard annotations.
Precision@K
Measures the fraction of the top-K predicted keyphrases that are actually correct (present in the gold standard). It answers: Of the K keyphrases we suggested, how many were right?
- Formula: (Number of correct predictions in top-K) / K
- Focus: Minimizing false positives and irrelevant suggestions
- Use case: Critical when users only scan the first few results and irrelevant terms erode trust
- Example: If a system predicts 10 keyphrases and 7 match the author's labels, Precision@10 = 0.7
Recall@K
Measures the fraction of the total gold-standard keyphrases that are successfully captured within the top-K predictions. It answers: Of all the correct keyphrases, how many did we find?
- Formula: (Number of correct predictions in top-K) / (Total number of gold-standard keyphrases)
- Focus: Minimizing false negatives and missed concepts
- Limitation: Recall can be artificially inflated by increasing K, which is why it must be paired with Precision
- Example: If a document has 8 author-assigned keyphrases and the top-10 predictions include 4 of them, Recall@10 = 0.5
Mean Reciprocal Rank (MRR)
Evaluates ranking quality by averaging the reciprocal of the rank position where the first correct keyphrase appears. Unlike F1@K, MRR focuses purely on the highest-ranked hit.
- Formula: MRR = (1/|Q|) × Σ (1 / rank_i), where rank_i is the position of the first relevant keyphrase
- Strength: Heavily rewards systems that place correct answers at the very top
- Contrast with F1@K: MRR cares about order; F1@K treats the top-K set as unordered
- Example: If the first correct keyphrase appears at rank 1, reciprocal rank = 1.0; if at rank 4, reciprocal rank = 0.25
Maximal Marginal Relevance (MMR)
A re-ranking algorithm that balances relevance against redundancy when selecting the final keyphrase set. It prevents the system from returning near-duplicate phrases.
- Mechanism: Iteratively selects phrases that maximize λ × Relevance(doc, phrase) − (1−λ) × max Similarity(phrase, already_selected)
- λ parameter: Controls the diversity-relevance trade-off; higher λ favors relevance
- Synergy with F1@K: MMR is applied post-candidate scoring to diversify the top-K set before F1 evaluation
- Common pitfall: Without MMR, systems often return "machine learning," "deep learning," and "neural networks" as three separate keyphrases when one would suffice
Reciprocal Rank Fusion (RRF)
A robust data fusion method that combines ranked lists from multiple keyphrase extraction systems into a single consensus ranking. It is the ensemble counterpart to single-model F1@K evaluation.
- Formula: RRF_score(d) = Σ (1 / (k + rank_i(d))), where k is a constant (typically 60)
- Advantage: Does not require score normalization across different algorithms, unlike weighted sum fusion
- Application: Used in ensemble scoring pipelines where outputs from TextRank, KeyBERT, and a supervised model are merged
- Relationship to F1@K: RRF produces the final ranked list on which F1@K is then computed
Candidate Scoring
The process of assigning a numerical weight to each candidate phrase based on features such as phraseness (linguistic well-formedness) and informativeness (topical relevance). This step directly determines the ranking evaluated by F1@K.
- Common features: TF-IDF, position in document, semantic similarity to document embedding, capitalization patterns
- Phraseness: Filters out grammatically incomplete n-grams like "learning algorithm the"
- Informativeness: Ensures generic phrases like "this paper" are downweighted
- Pipeline role: Candidate scoring is the final step before top-K selection; poor scoring guarantees poor F1@K regardless of candidate generation quality

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