Skip to main content

Sentimizer

About

Sentimizer will measure sentiment around specific entities within text. It is built on NLTK, Spacy, and NRCLex. Output is a dictionary that can be analyzed further, graphed, formulated into a wordcloud, etc.

References

Revision History

  • 2022-10-17: initial commit.

Example Usage

pip install sentimizer

Instantiate SentiMizer Object

from sentimizer import SentiMizer

analyzer = SentiMizer()

Load Text

Loads initial body of text.

analyzer.load_text(text : str)

attributes:

analyzer.text - attribute contains loaded text (str).

Append Text

For appending additional text to the initial input.

analyzer.append_text(text : str)

Entity Recognition

For identifying entities within the loaded body of text.

analyzer.find_entities()

optional parameters:

entity_types_of_interest - list of entity types for recognition. Default value is ['ORG', 'PERSON', 'FAC', 'GPE', 'LOC', 'EVENT'] All possible lables include: CARDINAL, DATE, EVENT, FAC, GPE, LANGUAGE, LAW, LOC, MONEY, NORP, ORDINAL, ORG, PERCENT, PERSON, PRODUCT, QUANTITY, TIME, WORK_OF_ART For a description of each, visit https://spacy.io/models/en.

attributes:

analyzer.entities - dictionary of entities and their tags (dict).

analyzer.sentences - dictionary of entities and concatenated sentences containing each entity (dict). Keys are entities and values are the concatenated sentences mentioning that entity.

Measure Emotional Content

For measuring sentiment and emotional affect of sentences that mention each entity.

analyzer.emote()

attributes:

analyzer.sentiments - Vader composite sentiment scores for each entity (dict). Keys are entities and values are the composite sentiment score for that entity.

analyzer.affect - NRCLex affect scores for each entity (dict). Keys are entities and the values are affect frequency dictionaries. optional parameters:

entity_type - string specifying the entity type to analyze. Default value is None. Default action is the analyze all entity types.

Metadata

Release files for sentimizer 2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sentimizer 2.0
File Size Uploaded
sentimizer-2.0.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sentimizer 2.0
File Interpreter ABI Platform
sentimizer-2.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / sentimizer-2.0.tar.gz

Download URL sentimizer-2.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a357c8bf4e71b973264b7a3c950a0bd4c86797dd7be0729cbaf58c988a3ddfae
BLAKE2b-256 checksum
How to use checksums
dad9bf94a98fe4c3bc9315f0d84c48853aa8bfec3191ef3ad7ba134a70cfd44d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release files / sentimizer-2.0-py3-none-any.whl

Download URL sentimizer-2.0-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3118a131fab4a268b97f726526bf32d9368232f58260958d17dc6eace1db3883
BLAKE2b-256 checksum
How to use checksums
664673f86e0ed94efcd14a2ec904d75ca0b10745b76a7b6d93bb59041f26dbf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release history Release notifications | RSS feed

This release

2.0 This release

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page