YouTube Comments / Sentiment Anlalysis / R

Daniel van Dongen

0

Data Scraper

Data Analyst

R

1. Introduction

Since November 2021, YouTube has deactivated the dislike function under each video and therefore an evaluation of the quality of a video is no longer possible or can only be estimated in a roundabout way. The objective of my analysis is to estimate the quality of a video based on the comments and determine what viewers liked or disliked about it. The video chosen for the analysis is the trailer of the new World of Warcraft expansion Dragonflight.
 

2. Methods

The programming language used for the preparation, analysis and visualization of the data was R. The analysis consists of 5 main parts, which are explained below.
Web-scraping Text-analysis Sentiment-Analysis Sentiment-Score N-grams & Correlations

2.1 Web scraping

The first part of the analysis was to scrape all comments existed and safe them in a appropriate format. Being able to scrape all YouTube comments was possible through using an R-package called 'tuber'. This package enabled to connect to the Google Cloud API key and download all comments available.
vid_data1 <- get_all_comments(video_id = "3ZtedjN1JXY")
For privacy reasons all usernames and other columns besides original text weren't used further.

2.2 Text-analysis + Preperation

To analyze the text some preparations were made. That includes the transformation to a 'tidy-format' which means that the table was transformed to a one token per row format (token = unit of text, can be one word or multiple ones (n-grams)). In addition the text was cleaned throught deleting all stop words (e.g. the, of, I) and converting all words to their root form (words without affixes). Now that the text is in a appropriate format the text-analysis could begin that includes counting the most frequent words and visualizing them through a wordcloud.
most frequent words word cloud
most frequent words as a word cloud
most frequent words as a word cloud

2.3 Sentiment-analysis

The third part was the sentiment analysis. In this part multiple sentiment lexicons were used to find out which sentiment each word represents. All lexicons used: bing Bing Liu and collaborators afinn Finn Årup Nielsen nrc Saif Mohammad and Peter Turney
 
To analyze the overall sentiment, sections were created that existed out of 20 comments each. Whereas the overall sentiment represents the sum of the sentiment content of the individual words. (1 index = summarised sentiment content of 20 comments)
bing afinn nrc
afinn lexicon
afinn lexicon

2.4 Sentiment-score

As we can see above the overall sentiment differs according to the lexicon used. For this reason, the sentiment score was created by calculating the total proportion of sentiments from each lexicon, applying a score to each proportion and combining them into an overall sentiment score.
These proportions were rated with a sentiment score that includes values from -9 to +9 (0 included).
lexicon sentiment score bing -2 afinn +2 nrc -1
These sentiment scores sum up to an overall sentiment score of -1. This score represents the overall sentiment of the viewership, so based on the comments there are a little bit more people which disliked this video. But keep in mind that this score can be strongly distorted because multiple problems like negations or words like 'wow' (standing for World of Warcraft instead of a positive sentiment) werent included.

2.5 N-grams & Correlations

In the last part of this analysis the goal was to find out what people liked or disliked about video and examine the problems we talked above (negations, misinterpreted words). This was possible due to analyzing consecutive sequences of words, called n-grams and analyzing the co-occurences of words in each comment using the phi coefficient to calculate binary correlation.
Beginning with n-grams, where we focused on using bigrams existing out of 2 consecutive words.
Using bigrams to provide context in sentiment analysis:
words that contributed most in the wrong direction (negations)
words that contributed most in the wrong direction (negations)
words that were adjacent to 'wow'
words that were adjacent to 'wow'
Visualizing bigram network:
(> bigram network arrow direction sympolizes the word sequence) (> arrow color intensity symbolizes the number of occurrences)
As we can see there are multiple interesting connections that give insight about what people may liked or disliked about the new expansion. For example many people used consecutive combination between words like 'worst -> wow -> cinematic' & 'boring -> trailer' & 'worst -> expansion -> trailer' & 'marketing/art -> team -> ruin' which implies that many people may disliked the work of the marketing/art team and perceive the new cinematic/trailer/expansion as boring/worst.
But there are also good combinations of consecutive words like 'amazing -> video' & 'cool -> anti -> heroes' or the comparison the older expansions like vanilla which implies that the video quality, the protagonists symbolizing the bad guys and the game in general were perceived as good.
Ending with correlations:
(> correlation network no arrows because relationships are symmetrical) (> line color intensity symbolizes the number of occurences)
As we can see many words that co-occured were words like 'art - team - cut - video - amazing' & ' dragonflight - cataclysm - legion- shadowlands vanilla' which indicates that many people liked the work of the art team and also compare the new expansion to the older ones what can be either good or bad related to which expansion was meant and how people felt about them.
The correlation network shows that looking at bigrams alone can lead to misinterpretation of comments. However, using both methods to gain deeper insight and comparing them, one can understand quite well what viewers liked or disliked the most.
 

3. Data

All data used for this analysis was scraped from the youtube video published by Blizzard. Click here for video Keep in mind that the data that was analyzed only includes all comments that were written till 05/05/2022(d-m-Y).
Like this project
0

Posted Oct 13, 2024

Comments are valuable, but how do we understand them when there are too many? This project provides sentiment scores to estimate overall feedback sentiment

Likes

0

Views

0

Tags

Data Scraper

Data Analyst

R

HR Analytics / Performance / Satisfaction - Dashboard
HR Analytics / Performance / Satisfaction - Dashboard
Ecommerce / Engagement - Dashboard
Ecommerce / Engagement - Dashboard