Skip to main content

A sentiment analysis library for detecting absolutist language.

Project description

A sentiment analysis library for detecting absolutist language.



$ 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.")
>>> absolutist("The bigger dog is running.")
>>> absolutist_index("He was completely bowled over.")
>>> absolutist("He was completely bowled over.")


  • 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.


  • 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.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for absolang, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size absolang-0.0.2.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page