emotion
This module is a emotion classifier that classifies emotion of a list of words and gives aggregated scores for each emotion. The classifier is based on NRC Affect Intensity Lexicon. The lexicon has close to 10,000 entries for eight emotions that Robert Plutchik argued to be basic or universal. Some words has multiple emotions to varying degree. Here is how the classifier works:
•The classifier first matches the words with the lexicon and fetches the emotions and intensity score for each matching from the lexicon.
• Then it sums the scores along the emotions and gives a mood score of the song. The emotion intensity are given from 0 to 1 in floats so the aggregated score is a float as well.
• It multiplies the number of appearances of these mood words in the song with the intensity score to give a corrected weighting of each emotion.
Installation
Run the following to install:
'''python pip install emotion_nrc_affect_lex '''
Usage
'''python from emotion import* text = ["love", "hate", "like"] em = Emo(text) em.weighted_emotion_scores em.affect_dict em.raw_emotion_scores em.word_frequencies '''
Metadata
Release files for emotion-nrc-affect-lex 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| emotion_nrc_affect_lex-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for emotion_nrc_affect_lex-0.0.2-py3-none-any.whl |
Release files / emotion_nrc_affect_lex-0.0.2-py3-none-any.whl
| Download URL | emotion_nrc_affect_lex-0.0.2-py3-none-any.whl |
|---|---|
| Size | 69.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d2e72f1d721dd2827348b82f85f6cf6b980c9f0d7369fa669ada8bca3afdf1bc
|
|
BLAKE2b-256 checksum How to use checksums |
24b9f4ae637632728d6b55b199cf3e3937dfb00602bec28a7d47caa33eaff062
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
|
Security for emotion-nrc-affect-lex 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.