semvec/pypi-packages huggingface dataset:
sampleproject-twine 2.0.0
A sample Python project
Requires Python: >=3.6, <4
Keywords: sample,setuptools,development

# A sample Python project

![Python Logo](https://www.python.org/static/community_logos/python-logo.png "Sample inline image")

A sample project that exists as an aid to the [Python Packaging User
Guide][packaging guide]'s [Tutorial on Packaging and Distributing
Projects][distribution tutorial].

This project does not aim to cover best practices for Python project
development as a whole. For example, it does not provide guidance or tool
recommendations for version control, documentation, or testing.

[The source for this project is available here][src].

Most of the configuration for a Python project is done in the `setup.py` file,
an example of which is included in this project. You should edit this file
accordingly to adapt this sample project to your needs.

----

This is the README file for the project.

The file should use UTF-8 encoding and can be written using
[reStructuredText][rst] or [markdown][md use] with the appropriate [key set][md
use]. It will be used to generate the project webpage on PyPI and will be
displayed as the project homepage on common code-hosting services, and should be
written for that purpose.

Typical contents for this file would include an overview of the project, basic
usage examples, etc. Generally, including the project changelog in here is not a
good idea, although a simple “What's New” section for the most recent version
may be appropriate.

[packaging guide]: https://packaging.python.org
[distribution tutorial]: https://packaging.python.org/tutorials/packaging-projects/
[src]: https://github.com/pypa/sampleproject
[rst]: http://docutils.sourceforge.net/rst.html
[md]: https://tools.ietf.org/html/rfc7764#section-3.5 "CommonMark variant"
[md use]: https://packaging.python.org/specifications/core-metadata/#description-content-type-optional
emotion-nrc-affect-lex 0.0.4
find emotion scores from a list of words

# 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:
1. Joy
2. Sadness
3. Anger
4. Fear
5. Disgust
6. Anticipation
7. Trust
8. Surprise


Lexicon source is (C) 2020 National Research Council Canada (NRC) and this package is **for research purposes only**. Source: [lexicons for research] (http://www.saifmohammad.com/WebPages/AffectIntensity.htm)
 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.

For now the input has to be a list of words rather than a text body. I will change it in the next update.  Please convert the text body into a list of words for using this package.

## Installation
Run the following to install:

```python
pip install emotion_nrc_affect_lex
```
## Usage
```python
from emotion import*
text = ['I','hate','everything','about','you','Why','do','I','love','you'] # The input should be a list of words. Please convert your text body to a list before using this package.
emo_object = Emo(text)
```
```python
# Gives aggregated emotion scores for the whole list.
emo_object.weighted_emotion_scores
```

```python
# Dictionary of each of the affect words
emo_object.affect_dict
```
```python
# Gives number of words for each emotion
emo_object.raw_emotion_scores
```
```python
# Gives a list of affect words and their frequencies
emo_object.word_frequencies
```