sklearn-crfsuite
CRFsuite (python-crfsuite) wrapper which provides interface simlar to scikit-learn
What it is and what it does
sklearn-crfsuite is a thin wrapper around python-crfsuite that exposes Conditional Random Fields (CRFs) through a scikit-learn compatible interface. CRFs are a machine learning model designed for sequence labeling tasks—predicting a label for each element in a sequence, where the prediction for one element can depend on surrounding elements. This is useful for problems like named entity recognition, part-of-speech tagging, or any task where you need to label sequences of data.
Because it follows scikit-learn's estimator API, you can use all of scikit-learn's standard tools with it: cross-validation, grid search for hyperparameter tuning, pipeline integration, and model serialization with joblib. The package includes utility functions for sequence-level metrics (like sequence_accuracy_score) and flat metrics (precision, recall) tailored to sequence labeling evaluation. Recent updates (0.5.0) ensure compatibility with modern scikit-learn versions by returning numpy arrays from predict methods.
Use it for:
- Named entity recognition: label person names, organizations, and locations in text using CRF with scikit-learn's cross-validation.
- Part-of-speech tagging: predict grammatical tags for words in sentences, leveraging scikit-learn's hyperparameter tuning.
- Information extraction: extract structured fields from documents by labeling token sequences with CRF models.
- Biomedical text mining: identify gene and protein mentions in scientific abstracts using sequence labeling.
- Slot filling in dialogue systems: label user utterance tokens to extract intent slots for conversational AI.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
sklearn-crfsuite wraps CRFsuite (Conditional Random Fields) as a scikit-learn compatible estimator, letting you train sequence labeling models using scikit-learn's standard tools like cross-validation and hyperparameter optimization.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a real problem—making CRFs accessible within scikit-learn workflows. Use it if you need sequence labeling and want to leverage scikit-learn's ecosystem for model selection and evaluation. The MIT license adds no restrictions.
Install
sklearn-crfsuite on PyPI
pip
pip install sklearn-crfsuiteuv
uv add sklearn-crfsuitepoetry
poetry add sklearn-crfsuiteInstalling sklearn-crfsuite
Before you install
Low friction: pure Python wheel with four straightforward runtime dependencies (python-crfsuite, scikit-learn, tabulate, tqdm). Actively maintained as of April 2026 with recent fixes to numpy array compatibility.
License in practice
MIT license is permissive; you can use this package in commercial and proprietary projects without restriction, though you must include the license notice.
Quickstart
pip install sklearn-crfsuite
from sklearn_crfsuite import CRF
crf = CRF()
crf.fit(X_train, y_train)
predictions = crf.predict(X_test)
Verify before relying
- Whether the package's 'Alpha' status reflects actual stability concerns or is simply outdated classifier metadata.
- Performance characteristics and typical model training time for large sequence datasets.
Package facts
| License | MIT license (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — python-crfsuite, scikit-learn, tabulate, tqdm |
| Maintenance | actively maintained — 787 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 591,755/month — #5,855 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sklearn_crfsuite-0.5.0-py2.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
python-crfsuitePython binding to CRFsuite for conditional…
permissive · top 5,000 on PyPI
tf2crfProvides a Conditional Random Field (CRF) layer…
permissive · top 15,000 on PyPI
sklearn-compatProvides backward-compatible wrappers for…
permissive · top 5,000 on PyPI
sklearndfWraps scikit-learn estimators to return pandas…
permissive · top 15,000 on PyPI
skopsSkops provides secure persistence and model…
unclear · top 5,000 on PyPI
skforecastSkforecast is a Python library for time series…
permissive · top 15,000 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
probablepeopleParses unstructured person and company names…
permissive · top 15,000 on PyPI
spark-sklearnDistributes scikit-learn model training and…
permissive · top 15,000 on PyPI
category-encodersTransforms categorical variables into numeric…
permissive · top 5,000 on PyPI