keyphrase-vectorizers
Set of vectorizers that extract keyphrases with part-of-speech patterns from a collection of text documents and convert them into a document-keyphrase matrix.
What it is and what it does
KeyphraseVectorizers wraps scikit-learn's CountVectorizer and TfidfVectorizer to extract keyphrases based on part-of-speech patterns rather than fixed n-gram ranges. It uses spaCy to tag words grammatically, then filters them by regex patterns (e.g., adjectives followed by nouns) to identify semantically meaningful phrases. The result is a document-keyphrase matrix where rows are documents and columns are unique keyphrases, with cell values representing keyphrase frequency or TF-IDF scores.
The package is designed for unsupervised keyphrase extraction across multiple languages and integrates with the PatternRank algorithm and KeyBERT for enhanced keyword discovery. It depends on numpy, spacy, scikit-learn, scipy, nltk, and related libraries. The codebase originated from research on the PatternRank paper and has remained stable but dormant since mid-2024.
Use it for:
- Extract grammatically coherent keywords from research papers or documents for indexing and retrieval.
- Build document-keyphrase matrices for topic modeling with BERTopic or other unsupervised clustering.
- Combine with KeyBERT using PatternRank to rank candidate keyphrases by semantic similarity.
- Preprocess multilingual document collections where n-gram ranges fail to capture meaningful phrases.
- Replace standard CountVectorizer in NLP pipelines when grammatical accuracy matters more than coverage.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Extracts keyphrases from text documents using part-of-speech patterns and produces document-keyphrase matrices compatible with scikit-learn's vectorizer interface.
Yes, if you need POS-pattern-based keyphrase extraction and accept dormant maintenance. The package is stable, has no known vulnerabilities, and integrates cleanly with scikit-learn and spaCy. Install friction is low. However, do not expect active development or rapid bug fixes; treat it as a research tool rather than a production library with ongoing support.
Install
keyphrase-vectorizers on PyPI
pip
pip install keyphrase-vectorizersuv
uv add keyphrase-vectorizerspoetry
poetry add keyphrase-vectorizersInstalling keyphrase-vectorizers
Before you install
Low friction: pure Python wheel with no compiled dependencies. Maintenance is dormant—last commit was 2024-11-08 and no release since 2024-05-02, so expect no active bug fixes or feature updates, though the codebase remains stable.
License in practice
BSD 3-Clause permissive license: you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions, provided you include the license text.
Quickstart
pip install keyphrase-vectorizers
from keyphrase_vectorizers import KeyphraseCountVectorizer
docs = ["Supervised learning maps inputs to outputs based on training examples."]
vectorizer = KeyphraseCountVectorizer()
vectorizer.fit(docs)
matrix = vectorizer.transform(docs).toarray()
keyphrases = vectorizer.get_feature_names_out()
Requires a spaCy language model (e.g., en_core_web_sm for English) to be installed separately for POS tagging to work.
Verify before relying
- Whether spaCy model download is automatic or requires manual setup before first use.
- Performance characteristics with large document collections or very long texts.
- Compatibility with recent spaCy versions beyond what the fact sheet indicates.
Package facts
| License | BSD 3-Clause "New" or "Revised" License (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — numpy, spacy, spacy-transformers, spacy-curated-transformers, nltk, scikit-learn, scipy, psutil |
| Maintenance | dormant — 834 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 87,242/month — #13,808 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: keyphrase_vectorizers-0.0.13-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
keybertKeyBERT extracts keywords and keyphrases from…
permissive · top 15,000 on PyPI
yakeYAKE extracts keywords from text documents…
copyleft · top 15,000 on PyPI
textacytextacy extends spaCy's NLP capabilities with…
permissive · top 15,000 on PyPI
rake-nltkExtracts keywords and key phrases from text…
permissive · top 15,000 on PyPI
ja-ginzaA pre-trained Japanese NLP model for spaCy that…
permissive · top 15,000 on PyPI
pytextrankPyTextRank implements graph-based TextRank and…
permissive · top 15,000 on PyPI
stop-wordsProvides curated stop-word lists for multiple…
permissive · top 15,000 on PyPI
textblobTextBlob provides a simple API for common…
permissive · top 5,000 on PyPI
bertopicBERTopic performs topic modeling on text…
permissive · top 15,000 on PyPI
ginzaGiNZA is a Japanese NLP library that performs…
permissive · top 15,000 on PyPI