Skip to content
Python Lightweight Sentiment Analysis Tool
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


lightweightsentiment is a Lightweight Sentiment Analysis Tool built using python.


It was written to conform to python 2 or 3 and requires the following modules installed (newer versions may work):



To install nltk run:

python3 -m textblob.download_corpora


Simply call the script using python3:

python3 --text "Gosh, I hate this feature"

Expected Output

The output would then be a number between -1.0 and 1.0. For example:


Training the Data Model

The data.json contains the model. You can add information programmatically using a seperate tool or train the data.json file using the --train option:

python --train="This is an great python script!" --label="pos"

CSV Usage

The script is called by a parsing script called The data.json and scripts should be in the same directory as well, with data.json acting as the model's training data.

python3 --file="Episodes_analysis_page.csv" --column="Group Description"


This is module across scripts so a service could be hosted as a lambda or google cloud function to process a csv or manual call per line. This facilitates calling from another application by simply sending the text in a standard json format with a response of the same floating point integer.

You can’t perform that action at this time.