Extract Emotion Words from Text or Word Tokens
Project description
EmotionExtractor
Extract emotion words from sentence or list of tokens.
Usage
ee = EmotionExtractor()
sentence = "I am happy to see you succeed"
tokens = ["I", "am", "happy", "to", "see", "you", "succeed"]
ee.extract_emotion(sentence)
#or
ee.extract_emotion(tokens)
extract_emotion(...)
can take several other optional parameters in addition to input sentence/word tokens:
:param bool lemmatize: Set to True to enable lemmatization. default is False
:param bool clean_stopwords: Set to False to disable stop words removal. default is True
:param bool remove_pos: Set to True if you'd like to only allow certain Parts of speech (POS). default s false
:param list allowed_pos: List of POS you want to allow from nltk TAGSET: https://github.com/nltk/nltk/blob/develop/nltk/app/chunkparser_app.py
a more readable list from third party: https://www.guru99.com/pos-tagging-chunking-nltk.html When it is not set, and remove_pos is set to True, then by default this POS whitelist is used: ["RB", "RBS", "RBR", "JJ", "JJR", "JJS"]
:param str filter: It can be set to either 'N' or 'P'. default is None.
Troubleshooting:
If you recieve error regarding nltk version not found
try:
pip install --upgrade nltk
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
EmotionExtractor-0.0.1.tar.gz
(66.6 kB
view hashes)
Built Distribution
Close
Hashes for EmotionExtractor-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6767b8e51731a6fba9047eef2662522150115e2a5e5511b0acf936927bc62b28 |
|
MD5 | c046dfb20e8bbb3350229d33b194399a |
|
BLAKE2b-256 | 9f2d0f48eb968bcb514cea353195ec811d8ac7b841f27c75f94d07a89e65ede7 |