Lexicon Classifier
Source code: https://github.com/draperunner/fjlc
This package is a Python port of the Lexicon Creator and Classifier of Valerij Fredriksen and Brage Ekroll Jahren (2016). It is compatible with Python version >= 3.
The original Java code is available here: https://github.com/freva/Masteroppgave
If using this package in your publications, please cite > Valerij Fredriksen and Brage Ekroll Jahren. Twitter Sentiment Analysis: Exploring Automatic Creation of Sentiment Lexica. Master’s thesis, 2016.
Installation
pip install fjlc
Lexicon Classifier
The LexiconClassifier uses the best performing lexicon of Fredriksen and Jahren. You can specify your own lexicon, see Options below.
Usage
from fjlc import LexiconClassifier
lc = LexiconClassifier()
You can classify a single tweet or a list of tweets:
>>> lc.classify("I am happy!")
'POSITIVE'
>>> lc.classify(["I am happy!", "I hate rain"])
['POSITIVE', 'NEGATIVE']
You can get the sentiment value of a single tweet or multiple tweets
>>> lc.classify("I am happy!")
5.599244615570646
>>> lc.classify(["I am happy!", "I hate rain"])
[5.599244615570646, -2.767224666516315]
Options
The LexiconClassifier takes three options: * lexicon: Path to sentiment lexicon file * options: Path to options file * dictionary: Path to canonical dictionary
Lexicon Creator
Usage
from fjlc import LexiconCreator
lc = LexiconCreator()
Incomplete, untested.
Metadata
Release files for fjlc 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fjlc-1.0.3.tar.gz | 60.0 kB | Without provenance | Details for fjlc-1.0.3.tar.gz |
Release files / fjlc-1.0.3.tar.gz
| Download URL | fjlc-1.0.3.tar.gz |
|---|---|
| Size | 60.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e814e2180ab45a35cf5eb44f9932b7a835aa0c3629bb1f45d7845b7805845bff
|
|
BLAKE2b-256 checksum How to use checksums |
df79419ed3bb473b7884eed30f734c7964493ba2e089511b6bbeb3b5f26bfabf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for fjlc 1.0.3
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.