skillfed

sklearn-crfsuite

CRFsuite (python-crfsuite) wrapper which provides interface simlar to scikit-learn

sklearn-crfsuite v0.5.0 591.8K downloads/30d#5,855 on PyPI440
Permissive license MIT license Active released

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

uv

uv add sklearn-crfsuite

poetry

poetry add sklearn-crfsuite

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

conditional random fields scikit-learnCRF sequence labelingsklearn compatible CRF estimatornamed entity recognition CRFsequence tagging with scikit-learnpython-crfsuite wrapperstructured prediction sklearn
sequence-labelingconditional-random-fieldsnlp

More Artificial Intelligence packages