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

Word Tokenization - Unexpected Output #139

Open
albertnanda opened this issue Jan 24, 2022 · 0 comments
Open

Word Tokenization - Unexpected Output #139

albertnanda opened this issue Jan 24, 2022 · 0 comments

Comments

@albertnanda
Copy link

Is this expected?

text = '''Mr. G. B. Shaw, known at his insistence simply as Bernard Shaw, was an Irish playwright.'''
print(blingfire.text_to_words(text).split())
print(list(nlp(text))) ##spacy

['Mr', '.', 'G', '.', 'B', '.', 'Shaw', ',', 'known', 'at', 'his', 'insistence', 'simply', 'as', 'Bernard', 'Shaw', ',', 'was', 'an', 'Irish', 'playwright', '.']
[Mr., G., B., Shaw, ,, known, at, his, insistence, simply, as, Bernard, Shaw, ,, was, an, Irish, playwright, .]

The dot(.) in Mr. and G. should be not treated as distinct token, it should be a single token.

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

1 participant