A web application that performs sentiment analysis on YouTube video comments. The application uses the YouTube Data API to fetch comments and then analyzes their sentiment using a pre-trained model. Results are visualized and displayed on a web interface.
Sentiment Analysis is a popular application of Natural Language Processing (NLP). This project focuses on analyzing YouTube comments to understand the sentiments expressed by viewers.
Hosted on GitHub Pages
๐ Live Demo Link
Below are the libraries and frameworks used to create the project:
- Web Framework: Flask
- Visualization: Matplotlib
- Sentiment Analysis Libraries: TensorFlow/Keras
- API Requests:
requests
The project currently includes:
- Comment Analysis - Fetches comments from a YouTube video using the YouTube Data API and analyzes their sentiment.
- Visualization - Displays sentiment distribution and insights using charts.
Application Interface
Sentiment Analysis Results
API documentation link - YouTube Data API Documentation
To work with the API, you need to create an API key. To create an API key, register on the Google Cloud Console and a unique key will be generated for you. Use this key to make successful API requests.
Note: Ensure your API key is kept secure and adhere to usage limits.
To fetch comments, the application performs the following API calls:
- Fetch Comments - Retrieve comments for a YouTube video using the YouTube Data API.
- Analyze Sentiment - Process the comments and analyze their sentiment.
API Endpoint for Comments - https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&videoId={videoId}&key={apiKey}
The project uses pre-trained models for sentiment analysis. Hereโs a brief overview of the tools used:
- TensorFlow/Keras - Libraries for building and using machine learning models for sentiment analysis.
Note:
- The sentiment analysis model classifies comments into sentiment categories (POSITIVE๐, NEGATIVE
โน๏ธ , NEUTRAL๐).
Future enhancements may include:
- Analyzing comments in different languages.
- Integrating with other social media platforms.
- Enhancing visualizations with interactive charts.
Thank you for exploring the project. I hope you find it useful.
If you did, please consider giving a starโญ to this repository. It would mean a lot!
ยฉ 2024 Rajeev Sharma | rajeevsharmamachphy@gmail.com