{"id":25926874,"url":"https://github.com/pratikagarwalla/sentiment-analysis-youtube","last_synced_at":"2026-05-01T22:35:23.170Z","repository":{"id":280095431,"uuid":"940971575","full_name":"PratikAgarwalla/sentiment-analysis-youtube","owner":"PratikAgarwalla","description":"The YouTube Comment Sentiment Analysis App analyzes the sentiment of comments on a given YouTube video. It helps users understand whether viewers are reacting positively, negatively, or neutrally to a video. This can be useful for content creators, marketers, and businesses to gauge audience reactions and feedback effectively.","archived":false,"fork":false,"pushed_at":"2025-03-01T07:08:52.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T08:18:50.162Z","etag":null,"topics":["matplotlib","nltk","pandas","python","streamlit","vader-sentiment-analysis"],"latest_commit_sha":null,"homepage":"https://sentiment-analysis-pro.streamlit.app","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PratikAgarwalla.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-03-01T07:02:24.000Z","updated_at":"2025-03-01T07:19:48.000Z","dependencies_parsed_at":"2025-03-01T08:28:58.760Z","dependency_job_id":null,"html_url":"https://github.com/PratikAgarwalla/sentiment-analysis-youtube","commit_stats":null,"previous_names":["pratikagarwalla/sentiment-analysis-youtube"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PratikAgarwalla%2Fsentiment-analysis-youtube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PratikAgarwalla%2Fsentiment-analysis-youtube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PratikAgarwalla%2Fsentiment-analysis-youtube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PratikAgarwalla%2Fsentiment-analysis-youtube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PratikAgarwalla","download_url":"https://codeload.github.com/PratikAgarwalla/sentiment-analysis-youtube/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241731744,"owners_count":20010781,"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":["matplotlib","nltk","pandas","python","streamlit","vader-sentiment-analysis"],"created_at":"2025-03-03T20:03:42.144Z","updated_at":"2025-12-01T01:05:20.056Z","avatar_url":"https://github.com/PratikAgarwalla.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎥 YouTube Comment Sentiment Analysis\n\n## 📌 Description\n\nThe **YouTube Comment Sentiment Analysis App** analyzes the sentiment of comments on a given YouTube video. It helps users understand whether viewers are reacting **positively, negatively, or neutrally** to a video. This can be useful for **content creators, marketers, and businesses** to gauge audience reactions and feedback effectively.\n\n### 🚀 **Use Cases**\n\n- **Content Creators**: Understand how viewers feel about their videos.\n- **Businesses**: Analyze customer feedback on promotional videos.\n- **Researchers**: Study audience engagement trends.\n- **Viewers**: Check sentiment before watching a video.\n\n## 🔄 **Process Flow**\n\n1. **User Inputs**: A **YouTube video URL** and the **number of comments** to analyze.\n2. **Extract Video ID**: The app extracts the video ID from the provided URL.\n3. **Fetch Comments**: Retrieves comments using the **YouTube Data API**.\n4. **Preprocessing**: Cleans and processes the extracted comments.\n5. **Sentiment Analysis**: Uses **VADER (Valence Aware Dictionary and sEntiment Reasoner)** to classify each comment as **Positive, Negative, or Neutral**.\n6. **Data Visualization**:\n   - **Bar Chart**: Compares positive and negative sentiments.\n   - **Pie Chart**: Shows the distribution of all sentiments.\n7. **Results Display**: Total analyzed comments and sentiment distribution.\n\n## 🧠 **Model Used: VADER (Sentiment Analysis)**\n\n**VADER (Valence Aware Dictionary and sEntiment Reasoner)** is a **lexicon-based** sentiment analysis model designed specifically for text from **social media, reviews, and comments**.\n\n### 🔍 **Why VADER?**\n\n- **Pre-trained**: No additional training required.\n- **Handles Emojis, Slang, and Capitalization**: Works well with **social media language**.\n- **Highly Accurate for Short Text**: Optimized for comment-based data.\n\n### 📊 **VADER Sentiment Scores**\n\nVADER calculates sentiment scores based on predefined word sentiments and assigns:\n\n- **Positive (compound score ≥ 0.05)** ✅\n- **Negative (compound score ≤ -0.05)** ❌\n- **Neutral (otherwise)** ⚪\n\n## 🛠 **Tech Stack \u0026 Libraries**\n\n### 🎯 **Frontend (UI)**\n\n- **Streamlit** - Interactive UI for input and visualization.\n\n### ⚙ **Backend (Processing \u0026 API Calls)**\n\n- **Python** - Core programming language.\n- **Google API Client** - Fetches YouTube comments.\n- **NLTK** - Natural Language Toolkit for sentiment analysis.\n- **Matplotlib** - Data visualization.\n- **dotenv** - Manages environment variables securely.\n- **pandas** - Handles data processing.\n\n## 🏗 **Installation \u0026 Setup**\n\n### 🔹 **1. Clone the Repository**\n\n```bash\ngit clone https://github.com/yourusername/youtube-sentiment-analysis.git\ncd youtube-sentiment-analysis\n```\n\n### 🔹 **2. Install Dependencies**\n\n```bash\npip install -r requirements.txt\n```\n\n### 🔹 **3. Set Up API Key Securely**\n\nCreate a `.env` file and add your **YouTube API Key**:\n\n```bash\nYOUTUBE_API_KEY=your_api_key_here\n```\n\n### 🔹 **4. Run the Streamlit App**\n\n```bash\nstreamlit run app.py\n```\n\n## 🎨 **Features**\n\n✅ Extracts \u0026 cleans comments from **any YouTube video**\n\n✅ **Real-time Sentiment Analysis** using **VADER**\n\n✅ **Bar Chart** (Positive vs. Negative Sentiments)\n\n✅ **Pie Chart** (Overall Sentiment Distribution)\n\n✅ **User-friendly UI** powered by **Streamlit**\n\n✅ **Secure API Handling** using environment variables\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratikagarwalla%2Fsentiment-analysis-youtube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpratikagarwalla%2Fsentiment-analysis-youtube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratikagarwalla%2Fsentiment-analysis-youtube/lists"}