No project description provided
Project description
Sentiment lexicon wrapper and generator.
Installation
pip install sentiment-lexicon
Usage
The module provides a single class, Lexicon, that can be used as a simple wrapper around sentiment lexicon data. The sentiment value of a given word can be accessed via the value instance method.
from sentiment_lexicon import Lexicon
lexicon = Lexicon(words, values)
lexicon.value('good') # => 1
The class can also generate a sentiment lexicon based on positive and negative input documents.
lexicon = Lexicon.from_labelled_text(positive_documents, negative_documents)
More information is available in the documentation.
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
Built Distribution
File details
Details for the file sentiment_lexicon-0.2.3.tar.gz
.
File metadata
- Download URL: sentiment_lexicon-0.2.3.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
4ff7060827366a189b668f7930cf273a1b5219c817e2a4fc5f5d1de9edd8b0ac
|
|
MD5 |
501de0c129d138365d9ba9deac83af37
|
|
BLAKE2b-256 |
013e394dba8bbdf195d0833c60084475c397247b39b83931c407d98de2340fbc
|
File details
Details for the file sentiment_lexicon-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: sentiment_lexicon-0.2.3-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
0c78ae022b51e28771a447fb553c7471bd08d5443e54299cc7a275d5281cab44
|
|
MD5 |
7c24000ee55d665a2f8e7ccafd31f6e2
|
|
BLAKE2b-256 |
bc52627d34807ef78cec7db76fa1a44d723716dce84c84c9b67b3a688c543d68
|