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

simple 'I', 'O', 'B' tagging throws error #46

Closed
moritzblum opened this issue Sep 30, 2020 · 2 comments
Closed

simple 'I', 'O', 'B' tagging throws error #46

moritzblum opened this issue Sep 30, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@moritzblum
Copy link

Since the last commit, the simple 'I', 'O', 'B' tags are no longer supported.

from seqeval.metrics import f1_score

y_true = [['O', 'O', 'O', 'B', 'I', 'I', 'O'], ['B', 'I', 'O']]
y_pred = [['O', 'O', 'B', 'I', 'I', 'I', 'O'], ['B', 'I', 'O']]
f1_score(y_true, y_pred)

Throws error:
ValueError: Invalid tag is found: B

Is this behaviour intended?

@Hironsan
Copy link
Member

Hmm, no. This is due to the validation.

@Hironsan
Copy link
Member

Quickfix:

if chunk in ['O', 'B', 'I']:
    return

@Hironsan Hironsan added the bug Something isn't working label Sep 30, 2020
Hironsan added a commit that referenced this issue Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants