metalcorebear / NRCLex

An affect generator based on TextBlob and the NRC affect lexicon. Note that lexicon license is for research purposes only.
MIT License
66 stars 39 forks source link

anticip or anticipation #19

Closed KavehKadkhoda closed 1 year ago

KavehKadkhoda commented 1 year ago

Hi, What a great package, thank you.

What do you think about the following outcome:

input code: text = 'In three years, everyone will be happy.' emotion = NRCLex(text) result = emotion.affect_frequencies result output: {'fear': 0.0, 'anger': 0.0, 'anticip': 0.0, 'trust': 0.25, 'surprise': 0.0, 'positive': 0.25, 'negative': 0.0, 'sadness': 0.0, 'disgust': 0.0, 'joy': 0.25, 'anticipation': 0.25}

There is 2 items that are anticip and anticipation, clearly one of them is extra but in the following example we have just one of them:

input code: text = 'Marie is a published author.' emotion = NRCLex(text) result = emotion.affect_frequencies result output: {'fear': 0.0, 'anger': 0.0, 'anticip': 0.0, 'trust': 0.5, 'surprise': 0.0, 'positive': 0.5, 'negative': 0.0, 'sadness': 0.0, 'disgust': 0.0, 'joy': 0.0}

Thank you for your time.

metalcorebear commented 1 year ago

Hey there. The "anticip." verses "anticipation" issue is just the result of my crappy coding. I accidentally put two names for the same variable. Anticipation is the result that you want to use. I have to update the code to remove the "anticip." vestigial variable. Glad you like the library!

KavehKadkhoda commented 1 year ago

Thank you. The library is great.