Skip to main content

Python library that collects tweets about movies, performs a sentiment analysis and correlates it with the boxoffice result of the 7 days 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 7 days 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 the average score and the average magnitude
  • 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 the average score, the average magnitude, their standard deviations and the percentage of positive tweets.

import mtsb

mtsb.sentiment()
  • sentiment_boxoffice_all()

Creates a dataframe with the following info for each movie: * Movie title and genres * Average mean and std of the tweets' scores and magnitudes * Percentage of positive and negative labelled tweets (if score==0 is labelled as positive) * Sum of the boxoffice of the 7 days 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.7.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

mtsb-0.0.7-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file mtsb-0.0.7.tar.gz.

File metadata

  • Download URL: mtsb-0.0.7.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for mtsb-0.0.7.tar.gz
Algorithm Hash digest
SHA256 c89d410ed4bdd643dfc006aba8ce9f4581794c91a3445ea4856b375c3dac432f
MD5 fdf0611d84760c8aad63115f250162e3
BLAKE2b-256 3ed51bbb6cfc332398ee706b1fc92c360c85cc1687c34007fa675e05f2cc8cd9

See more details on using hashes here.

File details

Details for the file mtsb-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: mtsb-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for mtsb-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e8728aa903070ec6909499171f4ed6b22133fe3975c135380926247fbc8e432d
MD5 ff26de6c24170f0b917fb351c32aa2bd
BLAKE2b-256 8a0bc548950c688c0911a2160b0115b206dd9b0131524f1a5f7cefa51b780908

See more details on using hashes here.

Supported by

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