Analyze sentiment in YouTube video comments using R
This project performs sentiment analysis on comments retrieved from a YouTube video using R programming and YouTube Data API v3. It fetches comments based on a video ID, cleans and processes the text, and classifies them as positive or negative using lexicon-based sentiment scoring.
Ideal for:
- π₯ YouTubers or marketers analyzing viewer response
- π Researchers studying social sentiment trends
- π§ Students exploring real-world NLP using R
- π Fetch comments using YouTube Data API
- π§Ή Text preprocessing (tokenization, stopwords removal, etc.)
- π Lexicon-based sentiment classification
- π Sentiment summary with visualizations (bar plot, pie chart, word cloud)
- π Option to export results to CSV
| Component | Technology |
|---|---|
| Language | R |
| Text Mining | tidytext, tm |
| API Integration | youtube comments API |
| Visualization | ggplot2, wordcloud |
| Data Wrangling | dplyr, tidyr |
- Go to Google Cloud Console
- Enable YouTube Data API v3
- Generate an API Key
- Update the following line with your API key and video ID:
api_key <- "YOUR_YOUTUBE_API_KEY" video_id <- "YOUR_VIDEO_ID"