Absolang
A sentiment analysis library for detecting absolutist language.
Quickstart
Installation:
$ pip install absolang $ python -m spacy download en_core_web_sm
Determining absolutist index for text:
>>> from absolang import absolutist, absolutist_index
>>> absolutist_index("The bigger dog is running.")
0.0
>>> absolutist("The bigger dog is running.")
False
>>> absolutist_index("He was completely bowled over.")
0.2
>>> absolutist("He was completely bowled over.")
True
Algorithm
Parse text into tokens using Spacy’s en_core_web_sm language model.
Count the number of word tokens (a token is considered a word if it consists solely of characters from the alphabet).
Count the number of absolutist word tokens (a token is considered absolutist if its stem word is in the dictionary of absolutist words and it is not preceded by a negation, modifier or interjection).
The absolutist index is the number of absolutist words divided by the total number of words.
Text is considered absolutist if the index is greater than 1.1 percent.
Caveats
The frequency of absolutist words in control texts (ones written by people presumed not to suffer from anxiety or depression more than the average person) is about 1%, so one needs a few hundred words of texts before results start becoming meaningful.
References
Metadata
Release files for absolang 0.0.2
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 |
|---|---|---|---|---|
| absolang-0.0.2.tar.gz | 4.0 kB | Without provenance | Details for absolang-0.0.2.tar.gz |
Release files / absolang-0.0.2.tar.gz
| Download URL | absolang-0.0.2.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
251c6ed97998f67852627170925a8f1059d5d5e0553682a165934b1d036e139d
|
|
BLAKE2b-256 checksum How to use checksums |
a8da0b8feb5187f95a076f237e01f777c9238afafb6f2e2748779dd522c32809
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for absolang 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.