{"id":28820670,"url":"https://github.com/lasithaamarasinghe/youtube-comment-analysis","last_synced_at":"2026-04-04T20:33:05.131Z","repository":{"id":299807507,"uuid":"953553797","full_name":"LasithaAmarasinghe/YouTube-Comment-Analysis","owner":"LasithaAmarasinghe","description":"Sentimental Analysis of comments on YouTube videos. Classify comments as positive, negative, or neutral. Provide visualizations to display the distribution of the sentiments.","archived":false,"fork":false,"pushed_at":"2025-06-18T11:18:02.000Z","size":7122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-18T12:30:17.163Z","etag":null,"topics":["comment-analysis","css3","emoji","flask","google-api-client","html5","matplotlib","negative","neutral","numpy","positive","python","sentiment-analysis","sentiment-classification","vadersentiment","visualization","youtube-video"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LasithaAmarasinghe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-23T16:24:36.000Z","updated_at":"2025-06-18T11:18:04.000Z","dependencies_parsed_at":"2025-06-18T12:32:34.770Z","dependency_job_id":"615790ee-af11-4834-925e-c721d77a2070","html_url":"https://github.com/LasithaAmarasinghe/YouTube-Comment-Analysis","commit_stats":null,"previous_names":["lasithaamarasinghe/youtube-comment-analysis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LasithaAmarasinghe/YouTube-Comment-Analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasithaAmarasinghe%2FYouTube-Comment-Analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasithaAmarasinghe%2FYouTube-Comment-Analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasithaAmarasinghe%2FYouTube-Comment-Analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasithaAmarasinghe%2FYouTube-Comment-Analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LasithaAmarasinghe","download_url":"https://codeload.github.com/LasithaAmarasinghe/YouTube-Comment-Analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasithaAmarasinghe%2FYouTube-Comment-Analysis/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260640636,"owners_count":23040495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["comment-analysis","css3","emoji","flask","google-api-client","html5","matplotlib","negative","neutral","numpy","positive","python","sentiment-analysis","sentiment-classification","vadersentiment","visualization","youtube-video"],"created_at":"2025-06-18T22:00:44.535Z","updated_at":"2025-12-30T22:30:09.457Z","avatar_url":"https://github.com/LasithaAmarasinghe.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YouTube-Comment-Analysis\n\nThis tool analyzes the sentiment of comments on YouTube videos. It uses sentiment analysis to classify comments as positive, negative, or neutral, and provides visualizations to display the distribution of these sentiments.\n\n\u003cimg src=\"https://github.com/LasithaAmarasinghe/YouTube-Comment-Analysis/raw/main/static/index.png\" width=\"800\" height=\"auto\"\u003e\n\n## 🎥 Demo\n\nHere’s a quick demo of the **YouTube-Comment-Analysis**:\n\n[![▶️ Watch the demo](https://github.com/LasithaAmarasinghe/YouTube-Comment-Analysis/raw/main/static/thumbnail.png)](https://vimeo.com/1068613686/94d8fc8668)\n\n## 🚀 Features\n\n- **YouTube Comment Analysis**: Fetch and analyze comments on a YouTube video.\n- **Sentiment Classification**: Categorizes comments into Positive, Negative, or Neutral sentiments.\n- **Visualization**: Displays sentiment distribution as bar and pie charts.\n- **Notable Comments**: Highlights the most positive and negative comments with sentiment scores.\n\n## 🛠️ Technologies/ Tools\n\n* Jupyter Notebook / [Google Colab](https://colab.research.google.com/)\n* Python 3+\n* Python packages\n  * Google API Client - `pip install google-api-python-client`\n  * VaderSentiment - `pip install vaderSentiment`\n  * Matplotlib - `pip install matplotlib`\n  * Emoji - `pip install emoji`\n  * Numpy - `pip install numpy`\n  * Flask - `pip install flask`\n* HTML5\n* CSS3\n \n![Python](https://img.shields.io/badge/python-3670A0?logo=python\u0026logoColor=FFFF00)\n![Jupyter Notebook](https://img.shields.io/badge/jupyter-%23FA0F00.svg?logo=jupyter\u0026logoColor=white)\n![Matplotlib](https://img.shields.io/badge/matplotlib-%23FF6F00)\n![vaderSentiment](https://img.shields.io/badge/vaderSentiment-purple)\n![Emoji](https://img.shields.io/badge/emoji-%23white)\n![NumPy](https://img.shields.io/badge/numpy-%23013243.svg?logo=numpy\u0026logoColor=white)\n![flask](https://img.shields.io/badge/flask_-black)\n![html5](https://img.shields.io/badge/html5-%23FF6F00.svg?logo=html5\u0026logoColor=white)\n![css3](https://img.shields.io/badge/css3-8A2BE2.svg?logo=css3\u0026logoColor=white)\n\n## 📖 Setup Instructions  \n\n1. Clone the repository:\n   ```sh\n   git clone https://github.com/LasithaAmarasinghe/YouTube-Comment-Analysis.git\n   ```\n2. Navigate to the project directory:\n   ```sh\n   cd YouTube-Comment-Analysis\n   ```\n3. Install dependencies:\n   ```sh\n   pip install -r requirements.txt\n   ```\n4. Set Up YouTube API\n\n   To interact with the YouTube API, you need an API key. Follow these steps to get a YouTube API key:\n\n    * Go to the [Google Developer Console](https://console.developers.google.com/).\n    * Create a new project.\n    * Enable the **YouTube Data API v3** for your project.\n    * Generate an **API key** for your project.\n    * Paste the generated API key into the `app.py` file under the `API_KEY` variable:\n\n    ```python\n    API_KEY = 'your_api_key_here'  # Replace with your actual API key\n    \n5. Run the Flask application:\n   ```sh\n   python app.py\n   ```\n\n6. Use the Analysis\n\n   * Open your browser and go to `http://127.0.0.1:5000/`.\n   * Enter the YouTube video URL in the provided input field.\n   * Click on **\"Analyze Comments\"** to process the comments of the video.\n   * The results page will display the sentiment analysis results along with sentiment distribution charts.\n  \n## 📝 How This Works\n\n1. **Extract Video ID**: The user provides a YouTube video URL, which is parsed to extract the video ID.\n2. **Fetch Comments**: The YouTube Data API fetches up to 1000 comments from the video.\n3. **Clean and Filter Comments**: The comments are cleaned (HTML tags removed) and filtered for relevance.\n4. **Sentiment Analysis**: Each comment is analyzed using **Vader Sentiment Analysis** to classify it as positive, negative, or neutral.\n5. **Visualization**: Visual representations of sentiment distributions are displayed as bar and pie charts.\n6. **Display Results**: Results, including sentiment statistics and notable comments, are shown to the user.\n\n## 📊 Results\n\n\u003cimg src=\"https://github.com/LasithaAmarasinghe/YouTube-Comment-Analysis/raw/main/static/result.png\" width=\"800\" height=\"auto\"\u003e\n\n\u003cimg src=\"https://github.com/LasithaAmarasinghe/YouTube-Comment-Analysis/raw/main/static/result2.png\" width=\"800\" height=\"auto\"\u003e\n\n\n## 📋 License\n \n * This project is licensed under the MIT License. See the [LICENSE](MIT-LICENSE.txt) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasithaamarasinghe%2Fyoutube-comment-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flasithaamarasinghe%2Fyoutube-comment-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasithaamarasinghe%2Fyoutube-comment-analysis/lists"}