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

O-labels treatment #98

Open
bschembri-UoM opened this issue Nov 9, 2022 · 1 comment
Open

O-labels treatment #98

bschembri-UoM opened this issue Nov 9, 2022 · 1 comment

Comments

@bschembri-UoM
Copy link

I would like to understand how seqeval treats sentences with no expected entities.

Taking the bellow example (adapted from the documentation);
actuals = [['O', 'O', 'O', 'B-MISC', 'I-MISC', 'I-MISC', 'O'], ['B-PER', 'I-PER', 'O'], ['O','O','O','O']]
preds = [['O', 'O', 'B-MISC', 'I-MISC', 'I-MISC', 'I-MISC', 'O'], ['B-PER', 'I-PER', 'O'], ['O','O','O','O']]
print(classification_report(actuals, preds, mode='strict', scheme=IOB2, digits=4))

I get the following output;

              precision    recall  f1-score   support

        MISC     0.0000    0.0000    0.0000         1
         PER     1.0000    1.0000    1.0000         1

   micro avg     0.5000    0.5000    0.5000         2
   macro avg     0.5000    0.5000    0.5000         2
weighted avg     0.5000    0.5000    0.5000         2

In case when a sentence is correctly predicted with no entities, isn't this sentence (labels) meant to be added to the metric calculations?
Looking at the support figure of "2" I believe that this implies that the last sentence is not taken into consideration.

Can you clarify this please?

  • Operating System: Ubuntu 20.04
  • Python Version: 3.7
  • Package Version: 1.2.2
@r-erd
Copy link

r-erd commented Apr 24, 2024

(I know this is old, but I hope that after I provide this answer, the issue might get closed)

The support is the number of sample used per class in calculation of classification metrics.
The last sentence without any annotations is still taken into consideration, but it doesnt add any true positives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants