seqeval is a Python framework for sequence labeling evaluation. It provides metrics like F1 score, precision, recall, and a detailed classification report for tasks such as named-entity recognition and part-of-speech tagging. It is currently at version 1.2.2 and maintains an active release cadence, with updates often focusing on performance improvements and additional evaluation schemes.
Install & Compatibility
Where this runs
tested against v1.2.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
build_error
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 11.5s · import 3.577s · 272MB
281MB installed
● package 281MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
from seqeval.metrics import accuracy_score
from seqeval.metrics import precision_score
from seqeval.metrics import recall_score
from seqeval.metrics import f1_score
from seqeval.metrics import classification_report
Used to specify a tagging scheme for metrics when needed.
from seqeval.scheme import IOB2
Calculate the F1-score and generate a detailed classification report for sequence labeling predictions.
from seqeval.metrics import f1_score
from seqeval.metrics import classification_report
y_true = [['O', 'O', 'B-MISC', 'I-MISC', 'B-MISC', 'O', 'O'], ['B-PER', 'I-PER', 'O']]
y_pred = [['O', 'O', 'B-MISC', 'I-MISC', 'B-MISC', 'I-MISC', 'O'], ['B-PER', 'I-PER', 'O']]
# Compute F1-score (micro average by default)
print(f"F1 Score (micro): {f1_score(y_true, y_pred):.2f}")
# Compute F1-score with different averaging methods
print(f"F1 Score (average=None): {f1_score(y_true, y_pred, average=None)}")
# Generate a full classification report
report = classification_report(y_true, y_pred, digits=2)
print("\nClassification Report:\n", report)
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.