This web application built with Flask analyzes comments from a YouTube video. It extracts comments using the YouTube Data API, performs sentiment analysis on them, generates a word cloud, and calculates precision and recall metrics.
-
Clone Repository: Clone this repository to your local machine:
git clone https://github.com/your_username/your_repository.git
-
Navigate to Directory: Navigate to the project directory:
cd your_repository
-
Install Dependencies: Install the required dependencies listed in
requirements.txt
:pip install -r requirements.txt
-
Obtain API Key: Obtain a YouTube Data API key from the Google Developers Console and replace
'YOUR_API_KEY'
inapp.py
with your actual API key.
-
Run Application: Run the Flask application:
python app.py
-
Access Web Interface: Open a web browser and go to
http://localhost:5000
to access the web interface. -
Enter Video URL: Enter the URL of the YouTube video you want to analyze and submit the form.
-
View Analysis: Wait for the analysis to complete. Once finished, the web page will display the word cloud of comments, the most positive and negative comments, and precision and recall metrics.
app.py
: Contains the Flask application code including routes and analysis functions.templates/
: Directory containing HTML templates for rendering the web pages.static/
: Directory for storing static files such as CSS stylesheets and client-side scripts.
- Flask: Web framework for Python.
- YouTube Data API: API for fetching YouTube data.
- TextBlob: Python library for processing textual data.
- WordCloud: Python library for creating word clouds.
- Matplotlib: Python plotting library for visualization.
- Bootstrap: Front-end component library for designing responsive web pages.
This project is licensed under the MIT License - see the LICENSE file for details.