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

Token classification pipeline results different with tokenizers==0.11.6 vs tokenizers==0.12.0 #16520

Closed
davidmezzetti opened this issue Mar 31, 2022 · 4 comments

Comments

@davidmezzetti
Copy link
Contributor

I'm not sure if this is an issue with transformers, an issue with tokenizers or expected behavior. But when running the token classification pipeline with an aggregation_strategy="simple" the results are slightly different with tokenizers==0.12.0.

The following code produces different results (both examples use transformers==4.17.0).

from transformers import pipeline
nlp = pipeline("token-classification")
nlp("Hugging Face Inc. is a company based in New York City", aggregation_strategy="simple")

With tokenizers==0.11.6:

[{'entity_group': 'ORG', 'score': 0.99305606, 'word': 'Hugging Face Inc', 'start': 0, 'end': 16}, {'entity_group': 'LOC', 'score': 0.9988098, 'word': 'New York City', 'start': 40, 'end': 53}]

With tokenizers==0.12.0:

[{'entity_group': 'ORG', 'score': 0.99305606, 'word': ['Hu', 'gging', ' Face', ' Inc'], 'start': 0, 'end': 16}, {'entity_group': 'LOC', 'score': 0.9988098, 'word': ['New', ' York', ' City'], 'start': 40, 'end': 53}]
@patil-suraj
Copy link
Contributor

cc @SaulLu @Narsil

@Narsil
Copy link
Contributor

Narsil commented Apr 1, 2022

There's a proposed PR here : #16537

@Narsil
Copy link
Contributor

Narsil commented Apr 1, 2022

Tokenization tests were run before releasing 0.12 but not the pipeline tests :(

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot closed this as completed May 8, 2022
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

3 participants