Skip to main content

Python library that collects tweets about movies, performs a sentiment analysis and correlates it with the boxoffice result of the week after the movie release.

Project description

MTSB

MTSB (Movie Tweet Sentiment Boxoffice) is a python module that collects tweets about movies, performs a sentiment analysis and correlates it with the boxoffice result of the week after the movie release.

Features

  • Collect tweets about movies
  • Creates hashtags for each movie
  • Performs sentiment analysis on those tweets using Google's API or Textblob and returns a mean score
  • Gets boxoffice data from boxofficemojo
  • Performs correlation between the sentiment analysis and boxoffice data

Requirements

Installation

In order to install MTSB you can simply:

pip install mtsb

Docs

  • tweet_collector()

Collect tweets about movies. It lets you choose between movies released in 2019 and releasing in 2020. It then creates a list of hashtags based on the movie's name and top actors and uses it to collect tweets from twitter.

import mtsb

mtsb.tweet_collector()
  • sentiment()

Performs sentiment analysis on collected tweets using Google's API or Textblob and returns a weighted geometric average of score and magnitude.

import mtsb

mtsb.sentiment()
  • sentiment_boxoffice_all()

Creates a dataframe with the following info for each movie: * Movie title * Weighted geometric average of score and magnitude (from sentiment() ) * Gross boxoffice for the week after the movie release

import mtsb

mtsb.sentiment_boxoffice_all()
  • spearman_corr(df)

Performs a spearman correlation using the df returned by sentiment_boxoffice_all().

mtsb.spearman_corr(df)

Links

Acknowledgements

Useful python libraries used:

Licence

MIT licensed. See the bundled LICENSE file for more details.

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

mtsb-0.0.2.tar.gz (11.3 kB view hashes)

Uploaded Source

Built Distribution

mtsb-0.0.2-py3-none-any.whl (10.9 kB view hashes)

Uploaded Python 3

Supported by

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