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

Capitalization Affecting Outcome #11

Open
Yangyi-Zhang opened this issue Feb 18, 2022 · 1 comment
Open

Capitalization Affecting Outcome #11

Yangyi-Zhang opened this issue Feb 18, 2022 · 1 comment

Comments

@Yangyi-Zhang
Copy link

Hi,

Thank you for the project. I saw different outputs when alternating the capitalization of input, for example:

text = "I love to visit historical places"
emotion = NRCLex(text)
print(emotion.top_emotions)

yields [('positive', 0.6666666666666666)], with raw emotion score {'joy': 1, 'positive': 2}.

while if I change text to "I Love to visit historical places", the top_emotions becomes [('positive', 1.0)].

How do we explain this? I understand this might not be an issue, but I am curious as a beginner in NLP.

@metalcorebear
Copy link
Owner

Thanks for bringing this up. I think we need to add a line of code to make all words within the examined corpus lowercase. That should overcome this issue, since the affect word list is all lowercase.

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