Skip to content

Automatically download and analyze the sentiment of YouTube subtitles with Gcloud's NLP API.

Notifications You must be signed in to change notification settings

titusss/Sentiment-Analysis-with-Gcloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sentiment Analysis of YouTube videos with Gcloud NLP API

Automatically download and analyze any YouTube video subtitles based on sentiment with Google's Natural Language API. Exports a CSV with score, magnitude, and overall sentiment and a transcript .txt file. Sentence query system is a simple fork of Gclouds NLP API tutorial for Sentiment Analysis.

Made for the 'PodPlot' assignment for UC Berkeley's 'Technology Design Foundations'.

Follow this tutorial for authentification: https://cloud.google.com/natural-language/docs/sentiment-tutorial?authuser=2

Make sure that you have satisfied the prerequisites mentioned in the tutorial above and that the GOOGLE_APPLICATION_CREDENTIALS variable shows the path to your JSON credentials.

Usage

python3 sentimentAnalysis.py "YouTube URL"

Example with the 'The next outbreak? We’re not ready | Bill Gates' TED talk

python3 sentimentAnalysis.py "https://www.youtube.com/watch?v=6Af6b_wyiwI"

Installation

Clone this repository, cd into it, and install the required packages with pip.

git clone https://github.com/titusss/Sentiment-Analysis-with-Gcloud.git
cd Sentiment-Analysis-with-Gcloud
pip install -r requirements.txt

Case Study

Example infographic created with Google Spreadsheet Charts. TDF_PodPlot_Export_03_MIRO

About

Automatically download and analyze the sentiment of YouTube subtitles with Gcloud's NLP API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages