# Comparison of Machine Learning for Sentiment Analysis in Detecting Anxiety Based on Social Media Data

소셜 미디어 데이터 기반 불안 탐지를 위한 감성 분석 머신러닝 비교

Shoffan Saifullah, Yuli Fauziah, Agus Sasmito Aribowo · arXiv · 2021년 1월 16일

- **연구 문제** COVID-19 대유행 상황에서 정부 프로그램에 대한 YouTube 댓글의 감성을 분석해 불안을 감지할 때 어떤 기계학습 분류기가 정확하고 균형 있게 작동하는지가 문제입니다.
- **연구 방법** YouTube 댓글을 크롤링해 전처리한 뒤 Count-Vectorization과 TF-IDF로 특징을 만들고, K-NN, Bernoulli, Decision Tree Classifier, Support Vector Classifier, Random Forest, XG-Boost를 교차검증으로 비교합니다.
- **주요 결과** Random Forest가 Count-Vectorization에서 accuracy 84.99%, TF-IDF에서 82.63%로 가장 높았습니다. K-NN은 precision, XG-Boost는 recall이 가장 높았으나 두 값의 불균형으로 단독 추천 기준이 되지 못한다고 저자들은 해석합니다.

## 연구 문제와 범위

2020년 COVID-19 대유행 이후 정부의 무료 전기 프로그램 같은 정책에 대한 대중 반응이 커졌고, 이 연구는 소셜미디어 댓글의 감성을 읽어 불안을 감지하려 합니다. 댓글은 부정(불안)과 긍정(희망, 불안하지 않음) 두 레이블로 나뉘며 감성 분석으로 구분합니다. 저자들은 기존에 적용된 방법이 앙상블 방법이 아니었다고 보고, Random Forest와 XG-Boost 같은 앙상블 방법을 포함한 여섯 분류기를 같은 전처리와 특징 추출 조건에서 비교합니다. 이 비교의 범위는 인도네시아어 YouTube 댓글 한 데이터셋으로 제한됩니다.

## YouTube 댓글 데이터와 레이블

데이터는 COVID-19 무료 전기 프로그램 관련 YouTube 댓글을 크롤링해 얻었습니다. 전체 4862건 가운데 부정 댓글은 3211건, 긍정 댓글은 1651건이며, 부정은 불안 상태를, 긍정은 희망을 가진 상태를 뜻하도록 정의됩니다. 레이블은 초기 분류 결과로 제시되고, 표 2에는 긍정과 부정 각각 다섯 개의 샘플 댓글이 제시됩니다. 두 클래스의 규모가 서로 다르므로, 정확도만으로 분류기를 판단할 때 precision과 recall을 함께 보는 것이 필요합니다.

## 전처리와 특징 추출

전처리는 tokenizing, filtering, stemming, tagging, 이모티콘 변환 단계로 구성됩니다. filtering에는 슬랭 단어 변환, 숫자와 불용어 제거, 중복 제거가 포함되며, 이모티콘은 정해진 규칙에 따라 완전한 문장 형태로 바뀝니다. 정제된 텍스트에 feature extraction으로 Count-Vectorization과 TF-IDF를 각각 적용합니다. Count-Vectorization은 말뭉치의 단어 빈도를 세어 문서를 표현하고, TF-IDF는 각 단어의 가중치를 계산하는 방식입니다. 두 표현은 같은 분류기에 입력되어 특징 방식에 따른 차이를 비교하는 데 쓰입니다.

![Figure 1: Pre-processing based on YouTube comments regarding the Government Electricity Program](https://refivu.com/papers/8412f077-3170-4e67-bb2c-f3ad167c019c/figures/figure-b16c5400fe47eb586f37ebaf78ec7fbf.png?thumb=512)

**Figure 1** . Pre-processing based on YouTube comments regarding the Government Electricity Program

[원문](https://arxiv.org/abs/2101.06353v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Shoffan Saifullah, Yuli Fauziah, Agus Sasmito Aribowo · Comparison of Machine Learning for Sentiment Analysis in Detecting Anxiety Based on Social Media Data · 원문 그림 인용 · 원본 PDF 3쪽에서 그림 영역을 추출했습니다.

## 여섯 분류기의 작동 방식

K-NN은 학습 데이터에서 가장 가까운 K개의 일치 항목을 찾아 레이블을 예측하며, 일반적으로 euclidean distance로 거리를 잽니다. Bernoulli는 문서를 단어 출현 여부의 이진 벡터로 보는 Naïve Bayes 모델입니다. Decision Tree Classifier는 속성 검사를 내부 노드로 두는 트리 구조로 레이블을 예측합니다. Support Vector Classifier는 두 클래스를 나누는 hyperplane을 찾으며, 고차원 데이터에서는 kernel tricks를 사용합니다. Random Forest는 여러 트리를 결합해 분류하고, XG-Boost는 Gradient Boosting을 바탕으로 이전 모델의 잔차를 이어서 예측하는 트리 앙상블입니다.

이 가운데 Random Forest와 XG-Boost는 저자들이 채택한 ensemble method의 대표로 제시됩니다.

## 평가 지표와 교차검증

각 분류기의 결과는 confusion matrix의 TP, TN, FP, FN으로 정리됩니다. accuracy는 \\(\\frac{TP+TN}{TP+TN+FP+FN}\\)이고, precision은 \\(\\frac{TP}{TP+FP}\\), recall은 \\(\\frac{TP}{TP+FN}\\)입니다. precision은 긍정으로 분류한 샘플 가운데 실제 긍정인 비율이고, recall은 실제 긍정 샘플 가운데 긍정으로 맞힌 비율입니다. 검증은 Cross-validation으로 수행되며, 데이터를 여러 학습과 검증 부분집합으로 나누어 반복하는 절차로 설명됩니다. 본문은 분할 수와 각 폴드의 편차를 보고하지 않습니다.

## 분류기별 정확도와 precision·recall

Count-Vectorization 특징에서 Random Forest의 accuracy는 84.99%였고, TF-IDF 특징에서는 82.63%였습니다. 두 특징 방식 모두에서 Random Forest가 accuracy 기준 가장 높은 값을 보였습니다. 같은 비교에서 K-NN은 precision이 가장 높았고, XG-Boost는 recall이 가장 높았습니다. 저자들은 이 두 값이 서로 균형을 이루지 않아 단독 추천 기준이 될 수 없다고 해석하며, 가장 일관된 방법으로 Random Forest를 제시합니다. 같은 Count-Vectorization 조건에서 Bernoulli, Decision Tree Classifier, Support Vector Classifier는 accuracy가 80%를 넘고 precision과 recall이 60 이상으로 나타나, 추가로 고려할 후보로 언급됩니다.

## 적용 범위와 한계

이 결과는 인도네시아어 YouTube 댓글 4862건과 무료 전기 프로그램이라는 한 주제, 두 레이블 설정에서 얻은 것입니다. 다른 플랫폼, 언어, 정책 주제에서도 같은 순위가 유지되는지는 이 연구의 실험으로 확인되지 않습니다. K-NN과 XG-Boost처럼 precision과 recall이 크게 엇갈리는 방법이 있어, 한 지표만으로는 추천 기준을 세우기 어렵습니다. 또한 교차검증의 분할 설정과 반복 간 변동이 본문에 제시되지 않아, 정확도 차이가 얼마나 안정적인지 판단하기 어렵습니다. 저자들은 이 결과를 불안 감지의 일반적 권고보다 방법 비교의 한 근거로 읽는 것이 적절하다고 해석합니다.

## 논문 정보

- **저자**: Shoffan Saifullah, Yuli Fauziah, Agus Sasmito Aribowo
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2021년 1월 16일
- **등록일**: 2026년 11월 6일
- **수정일**: 2021년 1월 16일
- **버전**: v1
- **arXiv**: 2101.06353
- **DOI**: 10.26555/jifo.v15i1.a20111
- **분류**: cs.CL · cs.LG
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2101.06353v1) · [원문 PDF ↗](https://arxiv.org/pdf/2101.06353v1)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

All groups of people felt the impact of the COVID-19 pandemic. This situation triggers anxiety, which is bad for everyone. The government's role is very influential in solving these problems with its work program. It also has many pros and cons that cause public anxiety. For that, it is necessary to detect anxiety to improve government programs that can increase public expectations. This study applies machine learning to detecting anxiety based on social media comments regarding government programs to deal with this pandemic. This concept will adopt a sentiment analysis in detecting anxiety based on positive and negative comments from netizens. The machine learning methods implemented include K-NN, Bernoulli, Decision Tree Classifier, Support Vector Classifier, Random Forest, and XG-boost. The data sample used is the result of crawling YouTube comments. The data used amounted to 4862 comments consisting of negative and positive data with 3211 and 1651. Negative data identify anxiety, while positive data identifies hope (not anxious). Machine learning is processed based on feature extraction of count-vectorization and TF-IDF. The results showed that the sentiment data amounted to 3889 and 973 in testing, and training with the greatest accuracy was the random forest with feature extraction of vectorization count and TF-IDF of 84.99% and 82.63%, respectively. The best precision test is K-NN, while the best recall is XG-Boost. Thus, Random Forest is the best accurate to detect someone's anxiety based-on data from social media.

## 원문 인용

Shoffan Saifullah, Yuli Fauziah, Agus Sasmito Aribowo (2021). Comparison of Machine Learning for Sentiment Analysis in Detecting Anxiety Based on Social Media Data. arXiv:2101.06353v1. https://doi.org/10.26555/jifo.v15i1.a20111

**BibTeX**

```
@article{saifullah2021comparison,
  title = {{Comparison of Machine Learning for Sentiment Analysis in Detecting Anxiety Based on Social Media Data}},
  author = {Shoffan Saifullah and Yuli Fauziah and Agus Sasmito Aribowo},
  year = {2021},
  eprint = {2101.06353},
  archivePrefix = {arXiv},
  doi = {10.26555/jifo.v15i1.a20111},
  url = {https://arxiv.org/abs/2101.06353v1}
}
```

## 이 논문의 용어

- [accuracy](https://refivu.com/terms/1995c0cd6282-accuracy)
- [recall](https://refivu.com/terms/3774987267f3-recall)
- [Precision](https://refivu.com/terms/29bee1303774-precision)
- [TF-IDF](https://refivu.com/terms/b8fd079027e3-tf-idf)
- [random forest](https://refivu.com/terms/e69b7b54f2ea-random-forest)
- [confusion matrix](https://refivu.com/terms/101b07f65787-confusion-matrix)
- [euclidean distance](https://refivu.com/terms/d709f3cd41c0-euclidean-distance)
- [cross-validation](https://refivu.com/terms/2abb0d8da39c-cross-validation)
- [gradient boosting](https://refivu.com/terms/10d874913acf-gradient-boosting)
- [k-NN](https://refivu.com/terms/f56ac38408a9-k-nn)
- [feature extraction](https://refivu.com/terms/f22ee0a5f12b-feature-extraction)
- [Bernoulli](https://refivu.com/terms/9d3950ec06af-bernoulli)
- [Decision Tree Classifier](https://refivu.com/terms/d73623db060e-decision-tree-classifier)
- [Support Vector Classifier](https://refivu.com/terms/8c0dc3a35e1f-support-vector-classifier)

## 다른 논문 해설

- [PADA: Example-based Prompt Learning for on-the-fly Adaptation to Unseen Domains](https://refivu.com/papers/1c1edf58-9646-4fc9-9631-5ddd3c11e749-pada-example-based-prompt-learning-for-on-the.md)
- [A Review of the Trends and Challenges in Adopting Natural Language Processing Methods for Education Feedback Analysis](https://refivu.com/papers/3d712d32-d3ac-415c-b662-8b657081f4c6-a-review-of-the-trends-and-challenges-in.md)
- [Training Tips for the Transformer Model](https://refivu.com/papers/f2437599-de07-4bc9-b659-4823dff3be26-training-tips-for-the-transformer-model.md)
- [Artificial intelligence contribution to translation industry: looking back and forward](https://refivu.com/papers/bb8c5e97-6b4d-4494-8e95-7693f7754127-artificial-intelligence-contribution-to-translation-industry.md)
- [Kencorpus: A Kenyan Language Corpus of Swahili, Dholuo and Luhya for Natural Language Processing Tasks](https://refivu.com/papers/63ecaace-b12e-4c8f-8421-3ed079f7ba82-kencorpus-a-kenyan-language-corpus-of-swahili-dholuo.md)
- [Assessing Text Classification Methods for Cyberbullying Detection on Social Media Platforms](https://refivu.com/papers/7faefd2d-5919-41ff-8a98-9f4d1c5bfc04-assessing-text-classification-methods-for-cyberbullying.md)
- [Aerobatic maneuvers in insect-scale flapping-wing aerial robots via deep-learned robust tube model predictive control](https://refivu.com/papers/6ef73e86-a3a5-44ae-b5a1-0de61ec39f56-aerobatic-maneuvers-in-insect-scale-flapping-wing-aerial.md)
- [Unsupervised Domain Adaptation with Variational Approximation for Cardiac Segmentation](https://refivu.com/papers/dec2638f-4fbc-4dda-91b9-72c25a7e7652-unsupervised-domain-adaptation-with-variational.md)
- [Neurosymbolic Reinforcement Learning and Planning: A Survey](https://refivu.com/papers/8ec66cdc-97be-4a1f-b0af-9c353d3464ef-neurosymbolic-reinforcement-learning-and-planning-a-survey.md)
- [Empirical Comparison of Four Stereoscopic Depth Sensing Cameras for Robotics Applications](https://refivu.com/papers/49e03081-cc87-4240-8656-3c76ff37c10a-empirical-comparison-of-four-stereoscopic-depth-sensing.md)
- [RGBT Tracking via Multi-Adapter Network with Hierarchical Divergence Loss](https://refivu.com/papers/698b9ab0-60b4-4a53-ad99-d4007ee9bb1e-rgbt-tracking-via-multi-adapter-network-with-hierarchical.md)
- [MSFMamba: Multi-Scale Feature Fusion State Space Model for Multi-Source Remote Sensing Image Classification](https://refivu.com/papers/50586b06-8f96-420c-97c6-f24af0d70503-msfmamba-multi-scale-feature-fusion-state-space-model.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/8412f077-3170-4e67-bb2c-f3ad167c019c-comparison-of-machine-learning-for-sentiment-analysis-in)
