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

Getting wrong results when target matches two predictions #84

Open
ShaiTAUB opened this issue Feb 6, 2025 · 1 comment
Open

Getting wrong results when target matches two predictions #84

ShaiTAUB opened this issue Feb 6, 2025 · 1 comment

Comments

@ShaiTAUB
Copy link

ShaiTAUB commented Feb 6, 2025

Consider this case:
pred = [[{'label': 'y', 'start': 0, 'end': 2}, {'label': 'x', 'start': 0, 'end': 2}]]
true = [[{'label': 'x', 'start': 0, 'end': 1}]]

Clearly, for tag 'x' and evaluation schema=Type, we expect to have 1 correct value, as there is a match in the label and an overlap in the span.
And indeed, when I run:

results = Evaluator(true=true, pred=pred, tags=['x']).evaluate()
results[1]['x']['ent_type']['correct']

I get a result of 1.

However, when I run:

results = Evaluator(true=true, pred=pred, tags=['x', 'y']).evaluate()
results[1]['x']['ent_type']['correct']

(asking for results for the two different tags)
I get a result of 0.

@omri374
Copy link

omri374 commented Feb 12, 2025

Swapping the order of the predictions returns the right values, hinting that this is indeed a bug

pred = [[{'label': 'x', 'start': 0, 'end': 2}, {'label': 'y', 'start': 0, 'end': 2}]]
true = [[{'label': 'x', 'start': 0, 'end': 1}]]

results = NERvaluator(true=true, pred=pred, tags=['x', 'y']).evaluate()
results[1]['x']['ent_type']['correct']

which returns 1

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