Inferensys

Glossary

YAKE

YAKE (Yet Another Keyword Extractor) is a lightweight, unsupervised automatic keyword extraction method that relies on statistical text features extracted from a single document to identify the most relevant keyphrases without external corpora.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
YET ANOTHER KEYWORD EXTRACTOR

What is YAKE?

YAKE is a lightweight, unsupervised keyphrase extraction algorithm that identifies relevant terms from a single document by leveraging statistical features without requiring external corpora or training data.

YAKE (Yet Another Keyword Extractor) is an unsupervised, corpus-independent algorithm that extracts keyphrases from a single document using five statistical features: casing, word position, word frequency, word relatedness to context, and word dispersion across sentences. It computes a final score for each candidate n-gram by multiplying these features, with lower scores indicating higher relevance. The method requires no external knowledge bases, making it highly portable and domain-agnostic.

The algorithm first segments text into sentences and tokens, then generates candidate phrases up to a maximum n-gram length (typically trigrams). Candidate scoring penalizes words that appear frequently across many sentences (low dispersion) while rewarding words that cluster in specific contexts. A deduplication step removes substrings with identical scores, and a final ranking returns the top-scoring phrases. YAKE excels in scenarios where labeled training data is unavailable and computational efficiency is paramount.

UNSUPERVISED KEYPHRASE EXTRACTION

Key Features of YAKE

YAKE (Yet Another Keyword Extractor) is a lightweight, unsupervised algorithm that extracts keyphrases from a single document using statistical features without requiring external corpora or training data.

01

Statistical Feature Scoring

YAKE computes five distinct statistical features for each candidate term to determine its relevance:

  • Casing: Rewards capitalized and acronym terms, penalizing lowercase words that are less likely to be important
  • Term Position: Boosts terms appearing early in the document, where key concepts are typically introduced
  • Term Frequency Normalization: Balances raw frequency against the frequency of sub-terms to prevent common words from dominating
  • Term Relatedness to Context: Measures how many different terms co-occur with the candidate, penalizing stopword-like behavior
  • Sentence Frequency: Rewards terms that appear across multiple sentences, indicating broader topical relevance

These features are combined into a single score, with lower values indicating higher keyword relevance.

02

Single-Document Processing

Unlike TF-IDF which requires a reference corpus to compute inverse document frequency, YAKE operates entirely on a single input document. This makes it ideal for:

  • Processing isolated documents where no corpus exists
  • Real-time applications with streaming text
  • Edge deployments with limited storage
  • Privacy-sensitive contexts where external data access is restricted

The algorithm builds its statistical model solely from the internal structure and distribution of terms within the provided text, eliminating corpus dependency entirely.

03

Sliding Window Co-occurrence

YAKE constructs a co-occurrence graph using a sliding window of configurable size (default: 10 words) across the document. This captures local semantic relationships:

  • Words appearing together frequently within the window receive higher relatedness scores
  • The window size can be tuned: smaller windows capture tight phrases, larger windows capture broader topical associations
  • This graph-based approach allows YAKE to identify multi-word expressions without relying on external phrase dictionaries

The co-occurrence statistics feed directly into the term relatedness feature, distinguishing content-bearing terms from functional words.

04

N-Gram Candidate Generation

YAKE generates candidate keyphrases by extracting contiguous n-grams up to a maximum length (default: 3 words). The process:

  • Splits text on stopwords and punctuation to identify phrase boundaries
  • Generates all possible 1-gram, 2-gram, and 3-gram sequences from these segments
  • Scores each candidate using the combined statistical features
  • Applies deduplication to remove redundant overlapping phrases

The stopword-delimited segmentation naturally identifies phrase boundaries without requiring part-of-speech tagging or syntactic parsing, keeping the algorithm fast and language-agnostic.

05

Language Independence

YAKE achieves broad language support through its reliance on statistical patterns rather than linguistic rules. Key design choices:

  • Uses a configurable stopword list as the only language-specific resource
  • Avoids dependency on POS taggers, parsers, or pretrained embeddings
  • Works effectively on languages with available stopword lists, including English, Spanish, French, German, Italian, and many others
  • The statistical features (casing, position, frequency) are language-agnostic

This makes YAKE suitable for multilingual document processing pipelines where maintaining language-specific NLP toolchains would be impractical.

06

Deduplication and Ranking

After scoring all candidate n-grams, YAKE applies a deduplication algorithm to remove redundant overlapping phrases:

  • If a longer phrase and its sub-phrase both appear as candidates, the algorithm compares their scores
  • The higher-scoring variant is retained while the lower-scoring duplicate is eliminated
  • This prevents both 'machine learning' and 'learning' from appearing in the final output when they represent the same concept
  • Final keyphrases are ranked by their composite score in ascending order (lower is better)

The result is a clean, non-redundant list of the most salient keyphrases extracted from the document.

UNSUPERVISED ALGORITHM COMPARISON

YAKE vs. Other Keyphrase Extraction Methods

A feature-level comparison of YAKE against other prominent unsupervised keyphrase extraction methods, highlighting architectural differences and operational characteristics.

FeatureYAKETF-IDFRAKETextRank

External Corpus Required

Statistical Feature Basis

5 features (casing, position, frequency, relatedness, sentence)

Term frequency × inverse document frequency

Word degree and frequency ratios

Graph centrality (PageRank)

Stopword Handling

Used as boundary delimiters and scored

Filtered out entirely

Used as boundary delimiters

Filtered out or retained as nodes

Candidate Generation Method

Sliding window n-grams (up to 3-grams)

Individual unigrams only

Stopword-delimited contiguous sequences

POS-filtered noun phrase chunks

Language Independence

Processing Speed (relative)

Fast (single-pass statistics)

Moderate (requires corpus-wide IDF)

Fast (linear scan)

Slow (iterative graph convergence)

Output Granularity

Unigrams, bigrams, trigrams

Unigrams only

Variable-length phrases

Variable-length phrases

Deduplication Strategy

Levenshtein similarity threshold

None (individual terms)

None (overlapping phrases retained)

Post-hoc redundancy removal

YAKE KEYPHRASE EXTRACTION

Frequently Asked Questions

Explore the mechanics and applications of YAKE, a lightweight unsupervised algorithm for extracting meaningful keyphrases from individual documents without external corpora.

YAKE (Yet Another Keyword Extractor) is a lightweight, unsupervised keyphrase extraction algorithm that identifies salient terms from a single document without relying on external corpora or pre-trained models. It operates by extracting candidate n-grams and scoring them using five distinct statistical features derived purely from the input text. These features include casing (capitalization bias), word position (positional relevance), word frequency (normalized term frequency), word relatedness to context (co-occurrence dispersion), and word different sentence (sentence frequency). The final score for each candidate is calculated by multiplying these features together, with lower scores indicating higher relevance. This self-contained approach makes YAKE highly portable and domain-agnostic, as it does not require a training phase or a reference corpus to compute inverse document frequencies.

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.