A Python framework for sequence labeling evaluation(named-entity recognition, pos tagging, etc...)
MIT License
Bot releases are visible (Hide)
Update setup.py to relax version pinning, fix #65
Published by Hironsan about 4 years ago
In strict mode, speed up the evaluation.
About 13 times faster.
Fixes #62
Published by Hironsan about 4 years ago
Enable to compute macro/weighted/perClass f1, recall, and precision #61
>>> from seqeval.metrics import f1_score
>>> 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']]
>>> f1_score(y_true, y_pred, average=None)
array([0.5, 1. ])
>>> f1_score(y_true, y_pred, average='micro')
0.6666666666666666
>>> f1_score(y_true, y_pred, average='macro')
0.75
>>> f1_score(y_true, y_pred, average='weighted')
0.6666666666666666
>>> from seqeval.metrics import precision_score
>>> 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']]
>>> precision_score(y_true, y_pred, average=None)
array([0.5, 1. ])
>>> precision_score(y_true, y_pred, average='micro')
0.6666666666666666
>>> precision_score(y_true, y_pred, average='macro')
0.75
>>> precision_score(y_true, y_pred, average='weighted')
0.6666666666666666
>>> from seqeval.metrics import recall_score
>>> 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']]
>>> recall_score(y_true, y_pred, average=None)
array([0.5, 1. ])
>>> recall_score(y_true, y_pred, average='micro')
0.6666666666666666
>>> recall_score(y_true, y_pred, average='macro')
0.75
>>> recall_score(y_true, y_pred, average='weighted')
0.6666666666666666
Published by Hironsan about 4 years ago
Add length check to classification_report v1 #59
Published by Hironsan about 4 years ago
Add BILOU as a scheme #56
Published by Hironsan about 4 years ago
In some cases, the behavior of the current classification_report is not enough. In the new classification_report, we can specify the evaluation scheme explicitly. This resolved the following issues:
Fix #23
Fix #25
Fix #35
Fix #36
Fix #39
Published by Hironsan about 4 years ago
classification_report outputs string/dict as requested in issue #41 #51
Published by Hironsan about 4 years ago
Stop raising exception when get_entities
takes a non-NE input #50
Published by Hironsan about 4 years ago
Update validation to fix #46 #47
Published by Hironsan about 4 years ago
Fix for classification report when tag contain dashes in their names or no tag #38
Published by Hironsan about 4 years ago
Add weighted average #32
Published by Hironsan about 4 years ago
Add validation for an input #30
Published by Hironsan about 4 years ago
Published by Hironsan over 5 years ago
Support both pre- and post- padding. See https://github.com/chakki-works/seqeval/pull/13.
Published by Hironsan over 5 years ago