Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Basic usage script for dictionary-based sentiment analysis. Intended use with labMT data

Project Description

TL;DR a simple labMT usage script

This script uses the language assessment by Mechanical Turk (labMT) word list to score the happiness of a corpus. The labMT word list was created by combining the 5000 words most frequently appearing in four sources: Twitter, the New York Times, Google Books, and music lyrics, and then scoring the words for sentiment on Amazon’s Mechanical Turk. The list is described in detail in the publication Dodds’ et al. 2011, PLOS ONE, “Temporal Patterns of Happiness and Information in a Global-Scale Social Network: Hedonometrics and Twitter.”

Given two corpora, the script “storylab.py” creates a word-shift graph illustrating the words most responsible for the difference in happiness between the two corpora. The corpora should be large (e.g. at least 10,000 words) in order for the difference to be meaningful, as this is a bag-of-words approach. As an example, a random collection of English tweets from both Saturday January 18 2014 and Tuesday January 21 2014 are included in the “example” directory. They can be compared by moving to the test directory, using the command

python example.py example-shift.html

and opening the file example-shift.html in a web browser. For an explanation of the resulting plot, please visit

http://www.hedonometer.org/shifts.html

Installation

Cloning the github directly is recommended, i.e.

git clone https://github.com/andyreagan/labMT-simple.git

and then installing locally using

sudo python setup.py install

Tests can be run by navigating to the test directory, and running

python test.py

which will compare the two days in test/data and print test.html which shifts them, allowing for a changable lens.

This repository can also be installed using pip

pip install labMTsimple

in which case you can download the tests from github and run them, if desired.

Release History

Release History

This version
History Node

2.8.4

History Node

2.8.3

History Node

2.8.2

History Node

2.8

History Node

2.7

History Node

2.3.4.4

History Node

2.3.4.3

History Node

2.3.4.2

History Node

2.3.4.1

History Node

2.3.4

History Node

2.3.3.1.1

History Node

2.3.3.1

History Node

2.3.3

History Node

2.3.2.1

History Node

2.3.2

History Node

2.3.1.9

History Node

2.3.1.8

History Node

2.3.1.7

History Node

2.3.1.6

History Node

2.3.1.5

History Node

2.3.1.3

History Node

2.3.1.2

History Node

2.3.1.1

History Node

2.3.1

History Node

2.2.2.1

History Node

2.2.1.3

History Node

2.2.1.1

History Node

2.2.1

History Node

2.2

History Node

2.1.4

History Node

2.1.3

History Node

2.1.2

History Node

2.1.1

History Node

2.1

History Node

2.0

History Node

1.2

History Node

1.1

History Node

1

History Node

0.3.4

History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.3

History Node

0.2

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
labMTsimple-2.8.4.tar.gz (3.7 MB) Copy SHA256 Checksum SHA256 Source Apr 14, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting