Catalog PyPI
Back to packageRELEASE DETAILS

0.0.2

PyPI

absolang

A sentiment analysis library for detecting absolutist language.

Published1 Jun 2018
Direct dependencies0
Transitive dependenciesNot calculated

README

Version 0.0.2 documentation
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
----------

* `In an Absolute State: Elevated Use of Absolutist Words Is a Marker Specific to Anxiety, Depression, and Suicidal Ideation <http://journals.sagepub.com/doi/pdf/10.1177/2167702617747074>`_

* `FCA Occasional Paper No. 8: Consumer Vulnerability <https://www.fca.org.uk/publications/occasional-papers/occasional-paper-no-8-consumer-vulnerability>`_

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 0

Native requirements
0 direct targetsNot calculated transitive count
No declared dependencies in this collected response

Declarations describe requirements; they are not a resolved dependency graph.

Distribution files

1 collected
absolang-0.0.2.tar.gz

sdist · 3.94 KB · Python source

Source file

Repository

PENDING
prodigyfinance/absolang

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:37 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:1abbf40daafadb0d75c8f7ff2d7ff60a71b23bd2647363e92549ada2de4fb9c2

Other collected versions

View all collected versions →