Install & Compatibility
Where this runs
tested against v0.7.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.855s · 109.3MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 5.5s · import 0.828s · 106MB
111MB installed
● package 111MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
KeywordExtractor
✓ from yake import KeywordExtractor
✗ import yake.KeywordExtractor
The `KeywordExtractor` class is directly available from the top-level `yake` package after `import yake`.
Initializes `KeywordExtractor` with default or custom parameters and extracts top keywords from a given text. The output is a list of (keyword, score) tuples.
import yake
text = """Sources tell us that Google is acquiring Kaggle, a platform that hosts data science and machine learning competitions.
Details about the transaction remain somewhat vague, but given that Google is hosting its Cloud Next conference in San Francisco this week,
the official announcement could come as early as tomorrow. Reached by phone, Kaggle co-founder CEO Anthony Goldbloom declined
to deny that the acquisition is happening. Google itself declined 'to comment on rumors'. Kaggle, which has about half a million
data scientists on its platform, was founded by Goldbloom and Ben Hamner in 2010."""
# Default parameters
kw_extractor = yake.KeywordExtractor()
keywords = kw_extractor.extract_keywords(text)
print("Keywords (default settings):")
for kw, score in keywords:
print(f"Keyphrase: {kw}, Score: {score}")
# Customizing parameters
# lan: language, n: max n-gram size, dedupLim: deduplication threshold,
# dedupFunc: deduplication function, windowsSize: window size, top: number of keywords
custom_kw_extractor = yake.KeywordExtractor(lan="en", n=3, dedupLim=0.9, dedupFunc='seqm', windowsSize=3, top=10, features=None)
keywords_custom = custom_kw_extractor.extract_keywords(text)
print("\nKeywords (custom settings):")
for kw, score in keywords_custom:
print(f"Keyphrase: {kw}, Score: {score}")
Debug
Known issues
breakingVersion 0.6.0 introduced a 'Refactored version of YAKE!'. Users upgrading from versions prior to 0.6.0 may encounter breaking API changes, particularly in how `KeywordExtractor` is initialized or its methods are called.fixRefer to the GitHub releases and documentation for migration details and updated `KeywordExtractor` usage patterns.
affects: <0.6.0 to >=0.6.0
gotchaIf using YAKE!'s lemmatization features (enabled via `spacy` or `nltk` optional dependencies), NLTK data (e.g., 'punkt') might be required, leading to `LookupError` if not downloaded.fixEnsure necessary NLTK data is present by running `import nltk; nltk.download('punkt')` (or other required data) in a Python interpreter or script before using lemmatization. affects: All versions with lemmatization
deprecatedAn older `yake` package (e.g., v0.3.x) is present on PyPI and is officially deprecated and unmaintained. Installing this older version will lead to outdated functionality and no support.fixEnsure you install the current, actively maintained version by using `pip install yake`. The current official repository is `https://github.com/INESCTEC/yake`.
affects: 0.3.x
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'yake'
The 'yake' package is not installed or the Python interpreter cannot find it in the current environment.
LookupError: Resource punkt not found. Please use the NLTK Downloader to obtain the resource: >>> import nltk >>> nltk.download('punkt')
The `punkt` tokenizer data, a common NLTK resource, has not been downloaded, and YAKE! (or its underlying dependencies for lemmatization) is attempting to use it.
fixRun `import nltk; nltk.download('punkt')` in a Python interpreter or script to download the necessary NLTK data. TypeError: 'tuple' object is not subscriptable
The `extract_keywords` method returns a list of tuples `(keyword, score)`. This error occurs if you try to access elements within these tuples using incorrect indexing (e.g., `keyword[0]` for the first element, `keyword['name']` like a dictionary, or treating the list itself as a dictionary).
fixIterate through the list of tuples and unpack them: `for kw, score in keywords: print(f"Keyword: {kw}, Score: {score}")` Upgrade
Version history
0.7.3latest on PyPI · released Feb 9, 2026
Audit
Dependencies
tabulaterequiredCLI table formatting
segtokrequiredSentence and token segmentation
networkxrequiredGraph manipulation
numpy>=1.24.0requiredNumerical operations
click>=6.0requiredCommand-line interface tools
jellyfishrequiredString comparison for deduplication
spacy>=3.8.0optionalFor lemmatization (optional dependency 'lemmatization')
nltk>=3.8.0optionalFor lemmatization and other text processing (optional dependency 'lemmatization')