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.lemma_ will lowercase the token #14

Open
HuaizhengZhang opened this issue Jan 22, 2019 · 5 comments
Open

word.lemma_ will lowercase the token #14

HuaizhengZhang opened this issue Jan 22, 2019 · 5 comments

Comments

@HuaizhengZhang
Copy link

text = ' '.join([word.lemma_ if word.lemma_ != '-PRON-' else word.text for word in text])

In the latest Spacy, after I run the code, the text will be lowercased. Actually, I do not want to do this at this stage. I think this is an issue.

@dipanjanS
Copy link
Owner

That would be more of a spacy issue I think, as far as I know typically any lemmatizer returns text in lower case. You might consider checking nltk but I am pretty sure they do the same.

Only option for you is to check the case of each word beforehand and then manually convert the case of the lemma after lemmatization if needed. Otherwise would need to send this request upstream to the spacy or nltk devs.

@HuaizhengZhang
Copy link
Author

Do we need to add some comments to explain this in your practical-machine-learning-with-python?

@HuaizhengZhang
Copy link
Author

People may be confused to see their results because no matter how they set the do_lowercase, they always get the lowercased text.

@dipanjanS
Copy link
Owner

yes definitely, that would be a good point to mention I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants