Skip to main content

Using empythy to score likability based on sentiment analysis of recent tweets about a given person

Project description

Using empythy to score likability based on sentiment analysis of recent tweets about a given person

Purpose

To piggyback off of the empythy natural languare classifier package to analyze average sentiment of tweets related to a particular person to calculate a ‘likability score’ for that person. Useful in tracking sentiment changes across a certain period of time, i.e. the likability score of a celebrity before and after a concert.

Instructions

  • Open terminal. Make sure you have python3 and pip downloaded.

  • pip install likability

  • Create a csv file with the names of the people you’d like to analyze for likability. Name this file name.csv in the current directory.

  • Determine how many recent tweets you’d like to query for each person. This will be used in the script below as num_tweets.

  • Make sure you have Twitter API keys and access tokens. If you do not, go to [Twitter Apps](https://apps.twitter.com/), create an app, and find the required keys and tokens under Applications Settings -> Consumer Key (API Key) -> manage keys and access tokens.

  • Run Python 3 by typing python into the terminal.

  • Enter script below to run the LikabilityAnalyzer module.

  • from likability import LikabilityAnalyzer

  • filepath = 'name.csv'

  • num_tweets = 100

  • sentimentScore = LikabilityAnalyzer.analyzer(filepath,num_tweets)

  • When prompted, enter in your Twitter API keys. This will allow likability to access the Twitter API to query the tweets needed to complete the sentiment analysis.

  • Wait for script to run to completion. Please note, due to Twitter API Rate Limiting, querying more than 15 names will lead to longer wait times. Please allow 1 minute per name for lists greater than 15 names.

  • Upon completion, open the newly created Sentiment.csv in the current directory to access the likability scores for each person.

Possible Usage

  • Score top fantasy football players to see what the Twittersphere thinks about each player pre-draft

  • Instead of names of people, use product names to track customer sentiment in real-time

  • Solve the question: who is more likable, Justin Timberlake or Jimmy Fallon

Project details


Download files

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

Source Distribution

lykability-1.0.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lykability-1.0.0-py2.py3-none-any.whl (11.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file lykability-1.0.0.tar.gz.

File metadata

  • Download URL: lykability-1.0.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lykability-1.0.0.tar.gz
Algorithm Hash digest
SHA256 38ac19a4a21732d22c8e9fe76e98b9c4ffc48862e6dbb88083e0cde8be69ba08
MD5 2730d8214861be7a3c78c761944927b4
BLAKE2b-256 d4e446c1fd7b51962f4aa2aa663d54d23d314dfbb01f865a2bdbddab6fdca0e0

See more details on using hashes here.

File details

Details for the file lykability-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for lykability-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5f3402deb36b370c2b9bf4b08673c340f8e6b1774167a5c4cb6a0e8bc9962873
MD5 9d5a225776f2de9478d16d645eeb787f
BLAKE2b-256 a69142d6fa164eaf0423f47f0f4ae7f62ea44fd4e1bd7b9352bb6451bdf6e073

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page