Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

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 files for labMTsimple 2.3.1.7

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

Source distribution (sdist)

Source distribution for labMTsimple 2.3.1.7
File Size Uploaded
labMTsimple-2.3.1.7.tar.gz 3.7 MB Details

Release files / labMTsimple-2.3.1.7.tar.gz

Download URL labMTsimple-2.3.1.7.tar.gz
Size 3.7 MB
Tags Source
SHA-256 checksum
How to use checksums
87f235b9268b0bc3f9237ac9e37e6e21d7e45083104d4d7b5fd269004d2efb55
BLAKE2b-256 checksum
How to use checksums
7b0d3b671e73980b694f6cdf91f91d8c3f2708abf68046719ec9d01581d63ad1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

2.3.1.7 This release

1 release file

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