Nothing Special   »   [go: up one dir, main page]

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

StanfordNERTagger couldn't process words contain space in. #3262

Open
Sion1225 opened this issue Jun 4, 2024 · 1 comment
Open

StanfordNERTagger couldn't process words contain space in. #3262

Sion1225 opened this issue Jun 4, 2024 · 1 comment

Comments

@Sion1225
Copy link
Sion1225 commented Jun 4, 2024
>>> from nltk.tag import StanfordNERTagger
>>> jar = [PATH]
>>> model = [PATH]
>>> st_ner = StanfordNERTagger(model, jar, encoding='utf8')
>>> print(st_ner.tag(["New York"]))
[('New', 'LOCATION')]
>>> print(st_ner.tag(["New York", "cat", "New", "work"]))
[('New', 'LOCATION'),
 ('York', 'LOCATION'),
 ('cat', 'O'),
 ('New', 'O')]

This class couldn't process words cotain space in themselves.

Words containing spaces are properly recognized but, during the output process, they are split based on spaces and output as multiple words. This causes the omission of the words that come after in the output.

@SharvariTatachar
Copy link

I can work on this!

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