--- id: keyphrase-vectorizers version: "0.0.13" license: BSD 3-Clause "New" or "Revised" License license_treatment: permissive maintenance: dormant --- # 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. License: permissive · Maintenance: dormant · Downloads: 87.2K/mo ## 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 above — 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 pip install keyphrase-vectorizers uv add keyphrase-vectorizers 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_current - Install friction: low - Maintenance: dormant - Downloads: 87.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags keyphrase extraction pos patterns, document keyphrase matrix, grammatical keyword extraction, spacy pos-based vectorizer, unsupervised keyphrase mining, sklearn-compatible text vectorizer, noun phrase extraction, nlp-text-processing, keyphrase-extraction, unsupervised-learning [View on SkillFed](https://skillfed.io/packages/keyphrase-vectorizers) · [View on PyPI](https://pypi.org/project/keyphrase-vectorizers/)