Code Monkey home page Code Monkey logo

youtube-sentiment-analysis's Introduction

YouTube Sentiment Analysis Tool

This tool analyzes the sentiment of comments on a YouTube video using the YouTube Data API and NLTK's VADER sentiment analyzer.

Setup

  1. Clone this repository:

    git clone https://github.com/yourusername/youtube-sentiment-analysis.git
    cd youtube-sentiment-analysis
    
  2. Install the required dependencies:

    pip install -r requirements.txt
    
  3. Set up a YouTube Data API key:

    • Go to the Google Developers Console
    • Create a new project or select an existing one
    • Enable the YouTube Data API v3
    • Create credentials (API key)
    • Set the API key as an environment variable:
      export YOUTUBE_API_KEY='your-api-key-here'
      

Usage

Run the script with a YouTube video ID as an argument:

python main.py VIDEO_ID

Replace VIDEO_ID with the ID of the YouTube video you want to analyze. The video ID is the value of the 'v' parameter in the video's URL. For example, if the video URL is https://www.youtube.com/watch?v=dQw4w9WgXcQ, the video ID would be dQw4w9WgXcQ.

Output

The tool will print the sentiment analysis results, including:

  • The total number of comments analyzed
  • The percentage of positive, neutral, and negative comments

Limitations

  • The tool is limited by the YouTube API's quota and rate limits.
  • Sentiment analysis is performed using a pre-trained model and may not always accurately capture the intended sentiment, especially for complex or nuanced comments.
  • The tool currently analyzes only the top-level comments and does not include replies.

License

This project is open source and available under the MIT License.

youtube-sentiment-analysis's People

Contributors

15athompson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.