Skip to content
Open access

Emotion Classification of YouTube Comments Using Cost Sensitive Support Vector Machine

Aug 2026 · Journal of Dinda Data Science Information Technology and Data Analytics · 0 citations · 16 references

Abstract

YouTube is the most widely used digital platform in the world, and its comment section serves as a rich space for emotional expression, particularly on music content. The song "Takut" by Idgitaf has gained over 58 million views, generating thousands of public responses with diverse emotional reactions that are inefficient to analyze manually. Previous studies focused on song lyrics rather than public responses, and conventional methods such as TF-IDF fail to capture the semantic context of informal language. This study aims to classify emotions in YouTube comments on "Takut" into eight categories based on the NRC Emotion Lexicon: anger, anticipation, disgust, fear, joy, sadness, surprise, and trust. A total of 13,462 comments were collected via the YouTube API v3 and processed through preprocessing, labeling, feature extraction, classification, and model evaluation. Preprocessing included cleaning, case folding, normalization, tokenization, stopword removal, and stemming. Labeling used the NRC Emotion Lexicon automatically, resulting in 7,239 labeled data points. Feature extraction employed Word2Vec with a 200-dimensional Skip-gram architecture to capture semantic context. Classification used Cost-Sensitive Support Vector Machine (CS-SVM) to handle class imbalance, with four kernels evaluated: Linear, Polynomial, RBF, and Sigmoid. The Linear kernel achieved the best performance with an accuracy of 70.72%, precision of 72%, recall of 71%, and F1-score of 71%. The fear class was detected most accurately with 239 correct predictions, while the minority surprise class was still identified with 6 correct predictions. Cost-penalty parameters proved effective in maintaining model sensitivity toward minority emotion classes.

Read PDF

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.