skillfed

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.

keyphrase-vectorizers v0.0.13 87.2K downloads/30d#13,808 on PyPI268
Permissive license BSD 3-Clause "New" or "Revised" License DORMANT released

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-vectorizers

uv

uv add keyphrase-vectorizers

poetry

poetry add keyphrase-vectorizers

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: Information Analysis

Tags

keyphrase extraction pos patternsdocument keyphrase matrixgrammatical keyword extractionspacy pos-based vectorizerunsupervised keyphrase miningsklearn-compatible text vectorizernoun phrase extraction
nlp-text-processingkeyphrase-extractionunsupervised-learning

More Artificial Intelligence packages