Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement/strict mode #54

Merged
merged 11 commits into from
Oct 11, 2020
Merged

Enhancement/strict mode #54

merged 11 commits into from
Oct 11, 2020

Conversation

Hironsan
Copy link
Member

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

For backward compatibility, we need to specify mode='strict' to use the new classification_report:

>>> from seqeval.metrics import classification_report
>>> y_true = [['B-A', 'B-B', 'O', 'B-A']]
>>> y_pred = [['O', 'B-B', 'B-C', 'B-A']]
>>> print(classification_report(y_true, y_pred, mode='strict'))
/Users/hironsan/Workspace/seqeval/venv/lib/python3.8/site-packages/seqeval-0.0.20.dev11+g52f742b.d20201011-py3.8.egg/seqeval/metrics/v1.py:57: UndefinedMetricWarning: Recall and F-score are ill-defined and being set to 0.0 in labels with no true samples. Use `zero_division` parameter to control this behavior.
              precision    recall  f1-score   support

           A       1.00      0.50      0.67         2
           B       1.00      1.00      1.00         1
           C       0.00      0.00      0.00         0

   micro avg       0.67      0.67      0.67         3
   macro avg       0.67      0.50      0.56         3
weighted avg       1.00      0.67      0.78         3

@Hironsan Hironsan merged commit 91215f5 into master Oct 11, 2020
@Hironsan Hironsan deleted the enhancement/strictMode branch October 11, 2020 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant