# Short text classification with machine learning in the social sciences: The case of climate change on Twitter

사회과학에서 기계학습을 활용한 짧은 텍스트 분류: 트위터의 기후 변화 사례

Karina Shyrokykh, Maksym Girnyk, Lisa Dellmuth · arXiv · 2023년 10월 3일

- **연구 문제** 소규모이고 불균형한 라벨 데이터에서 짧은 텍스트, 특히 기후변화 관련 트윗을 분류할 때 사전 기반 방법과 지도학습 방법 중 어느 쪽이 더 나은지가 문제입니다.
- **연구 방법** 사전 기반 분류기와 로지스틱 회귀, SVM, 랜덤 포레스트, KNN, 나이브 베이즈, FCNN, CNN, LSTM을 같은 라벨 데이터에서 비교합니다.
- **주요 결과** 원래 불균형 데이터에서는 랜덤 포레스트와 로지스틱 회귀가 상위권이었고, 균형 데이터에서는 방법 간 차이가 줄었습니다. KNN과 사전 기반 분류기는 다른 방법과 유의하게 다른 성능을 보였습니다.

## 소규모 불균형 라벨 데이터의 텍스트 분류 문제

사회과학 연구자는 대량의 텍스트를 분류해야 하지만, 수작업 라벨링이 어려운 경우가 많습니다. 이 논문은 라벨 데이터는 적고 관심 범주는 드문 설정, 즉 소규모 불균형 데이터에서 사전 기반 분류기와 지도학습 분류기의 성능을 비교합니다. 사례는 UN 산하 여러 국제기구의 트위터 게시물이며, 전체 222,191개 트윗 중 무작위로 선택한 5,750개에 기후변화 관련 여부를 이진 라벨로 붙였습니다. 기후변화 관련 트윗은 전체의 약 9%에 불과합니다. 이 불균형 때문에 모든 트윗을 기후변화 무관으로 예측해도 약 91%의 정확도가 나오므로, 정확도만으로는 분류기의 쓸모를 판단하기 어렵습니다.

## 사전 기반 분류기와 지도학습 분류기의 작동 방식

사전 기반 분류기는 전문가가 만든 키워드 목록을 트윗의 토큰과 대조합니다. 이 논문은 climate, climatechange, globalwarming, climaterealists, agw의 다섯 용어를 사용하며, 일치하는 단어가 하나라도 있으면 기후변화 관련으로 분류하고 없으면 무관으로 분류합니다. 지도학습은 사람이 라벨링한 데이터로 모델의 매개변수를 학습해 새 트윗의 라벨을 예측합니다. 전통적 기계학습 분류기로 로지스틱 회귀, 선형 커널 SVM, 랜덤 포레스트, KNN, 다항 나이브 베이즈를 사용합니다. 로지스틱 회귀는 시그모이드 함수로 양성 클래스의 조건부 확률을 모델링합니다. 랜덤 포레스트는 배깅과 특성 부분집합 선택으로 여러 결정트리를 만들고 다수결로 예측합니다.

KNN은 학습 단계에서 데이터를 저장해 두고, 예측할 때 k개 최근접 이웃의 다수결로 분류합니다. 나이브 베이즈는 특성들이 라벨이 주어졌을 때 서로 조건부 독립이라고 가정하며, 관측되지 않은 특성에는 라플라스 평활화를 적용합니다. 신경망으로는 FCNN, CNN, 양방향 LSTM을 사용하며 이들은 출력 직전의 한 층만 다르고 나머지 구조는 공통입니다. 신경망은 역전파와 Adam 최적화로 학습하고, 이진 교차 엔트로피 손실을 사용합니다. 트윗은 정제와 토큰화 후 count vectorizer, TF-IDF, Keras tokenizer 중 하나로 벡터화되며, 최적 선택은 하이퍼파라미터 탐색의 일부로 정해집니다.

## 데이터 구축과 평가 설정

연구팀은 222,191개 트윗 중 5,750개를 무작위로 골라 세 명의 연구보조원이 각각 2,000개씩 라벨링했습니다. 보조원 사이의 중복 250개는 제외하여 최종적으로 5,750개 관측치를 얻었습니다. 중복 구간에서 측정한 코더 간 일치율은 평균 96%였고 Cohen의 κ는 0.95였습니다. 데이터는 85%의 학습 세트와 15%의 테스트 세트로 나뉩니다. 학습 세트의 약 15%는 하이퍼파라미터 튜닝을 위한 검증 세트로 쓰였고, 튜닝은 베이즈 최적화와 tree-structured Parzen estimator로 수행되었습니다. 평가는 테스트 세트의 예측 라벨을 실제 라벨과 비교하여 계산합니다. 혼동행렬의 네 칸에서 정밀도와 재현율을 구하고, 이 둘의 조화평균인 F1 score를 주 지표로 사용합니다.

정밀도는 양성으로 분류된 사례 중 실제 양성인 비율이고, 재현율은 실제 양성 중 올바르게 찾은 비율입니다. 또한 균형 비율을 바꾸기 위해 Kaggle의 기후변화 감정 데이터셋에서 기후변화 관련 트윗을 추가했으며, 학습과 테스트 세트에 원래 데이터를 그대로 포함시켰습니다.

## 원래 데이터와 균형 데이터에서의 비교

원래 불균형 데이터에서 F1 score는 랜덤 포레스트가 0.649573으로 가장 높았고, 로지스틱 회귀는 0.647619로 근소하게 뒤따랐습니다. 두 방법은 정교한 신경망보다 높은 성능을 보였습니다. 사전 기반 분류기는 F1 score 0.618557을 기록했고, KNN은 0.293333으로 가장 낮았습니다. 원래 데이터셋의 F1 score는 대체로 낮았으며, 저자들은 이를 클래스 불균형과 작은 데이터 규모 탓으로 해석합니다. 균형 데이터셋에서는 CNN이 F1 score 0.970347로 가장 높았지만, 랜덤 포레스트 0.969891과 로지스틱 회귀 0.968928과의 차이는 작습니다. 이 맥락에서 McNemar 검정은 대부분의 분류기 쌍에서 오류 분포의 차이가 유의하지 않다는 결과를 보였습니다.

유의한 차이는 KNN과 사전 기반 분류기가 나머지 방법과 맺는 쌍에서만 나타났습니다. 균형 비율을 0.09에서 1.0까지 바꾸어 본 실험에서는 모든 방법의 성능이 균형이 높아질수록 좋아졌고, 방법 간 차이는 줄어들었습니다. 학습 시간은 로지스틱 회귀와 랜덤 포레스트가 1초 미만인 반면, CNN은 119초, FCNN은 133초, LSTM은 185초였습니다. 따라서 이 설정에서는 전통적 방법이 신경망과 비슷한 성능을 더 짧은 학습 시간으로 내는 것으로 읽힙니다.

## 지표와 적용 범위의 한계

본 논문의 주 지표인 F1 score는 기후변화 관련 현상을 직접 측정하지 않으며, 원문은 여러 지표를 함께 보고하는 것이 더 유익할 수 있다고 언급합니다. 정밀도와 재현율은 서로 맞바꿀 수 있는 관계에 있으므로, F1 score 하나로 두 측면을 모두 설명하기는 어렵습니다. 균형 실험은 Kaggle 데이터를 추가하여 만든 조건이므로, 결과는 이 조건에서 얻어진 것입니다. 결과를 UN 기관 트윗 전체의 분포나 다른 주제의 텍스트에 그대로 적용하려면 별도의 검증이 필요합니다.

## 논문 정보

- **저자**: Karina Shyrokykh, Maksym Girnyk, Lisa Dellmuth
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2023년 10월 3일
- **등록일**: 2026년 11월 6일
- **수정일**: 2023년 10월 3일
- **버전**: v1
- **arXiv**: 2310.04452
- **DOI**: 10.1371/journal.pone.0290762
- **분류**: cs.CL · cs.LG · stat.ME
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

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

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

## 초록

To analyse large numbers of texts, social science researchers are increasingly confronting the challenge of text classification. When manual labeling is not possible and researchers have to find automatized ways to classify texts, computer science provides a useful toolbox of machine-learning methods whose performance remains understudied in the social sciences. In this article, we compare the performance of the most widely used text classifiers by applying them to a typical research scenario in social science research: a relatively small labeled dataset with infrequent occurrence of categories of interest, which is a part of a large unlabeled dataset. As an example case, we look at Twitter communication regarding climate change, a topic of increasing scholarly interest in interdisciplinary social science research. Using a novel dataset including 5,750 tweets from various international organizations regarding the highly ambiguous concept of climate change, we evaluate the performance of methods in automatically classifying tweets based on whether they are about climate change or not. In this context, we highlight two main findings. First, supervised machine-learning methods perform better than state-of-the-art lexicons, in particular as class balance increases. Second, traditional machine-learning methods, such as logistic regression and random forest, perform similarly to sophisticated deep-learning methods, whilst requiring much less training time and computational resources. The results have important implications for the analysis of short texts in social science research.

## 원문 인용

Karina Shyrokykh, Maksym Girnyk, Lisa Dellmuth (2023). Short text classification with machine learning in the social sciences: The case of climate change on Twitter. arXiv:2310.04452v1. https://doi.org/10.1371/journal.pone.0290762

**BibTeX**

```
@article{shyrokykh2023short,
  title = {{Short text classification with machine learning in the social sciences: The case of climate change on Twitter}},
  author = {Karina Shyrokykh and Maksym Girnyk and Lisa Dellmuth},
  year = {2023},
  eprint = {2310.04452},
  archivePrefix = {arXiv},
  doi = {10.1371/journal.pone.0290762},
  url = {https://arxiv.org/abs/2310.04452v1}
}
```

## 이 논문의 용어

- [accuracy](https://refivu.com/terms/1995c0cd6282-accuracy)
- [Adam](https://refivu.com/terms/0e9ad0199e08-adam)
- [recall](https://refivu.com/terms/3774987267f3-recall)
- [Precision](https://refivu.com/terms/29bee1303774-precision)
- [F1 score](https://refivu.com/terms/220c2aa29a7c-f1-score)
- [logistic regression](https://refivu.com/terms/3551369d301a-logistic-regression)
- [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)
- [Long Short-Term Memory](https://refivu.com/terms/1eac61fff4b1-long-short-term-memory)
- [backpropagation](https://refivu.com/terms/e09284f057ac-backpropagation)
- [Bayesian optimization](https://refivu.com/terms/f408f0ab6835-bayesian-optimization)
- [McNemar test](https://refivu.com/terms/c50ac853455f-mcnemar-test)
- [Cohen’s κ](https://refivu.com/terms/5c45c62b2467-cohen-s)
- [hinge loss](https://refivu.com/terms/81cbdf4a8c8a-hinge-loss)
- [Bagging](https://refivu.com/terms/cc6b5bcfb655-bagging)
- [Support vector machines](https://refivu.com/terms/e3fc6dee1b39-support-vector-machines)
- [overfitting](https://refivu.com/terms/82a66a720533-overfitting)
- [Bag-of-Words](https://refivu.com/terms/ab87ee9e2ea7-bag-of-words)
- [Laplace smoothing](https://refivu.com/terms/0edf6c0b6c51-laplace-smoothing)
- [Tree-structured Parzen Estimator](https://refivu.com/terms/0955cd16de87-tree-structured-parzen-estimator)
- [validation set](https://refivu.com/terms/fb88f9951801-validation-set)
- [K nearest neighbors](https://refivu.com/terms/423d3393aceb-k-nearest-neighbors)
- [kernel trick](https://refivu.com/terms/db092cb51fb3-kernel-trick)

## 다른 논문 해설

- [Domain Adaptation with Pre-trained Transformers for Query Focused Abstractive Text Summarization](https://refivu.com/papers/e09e0a55-c163-4f22-8a52-05215b31a3d1-domain-adaptation-with-pre-trained-transformers-for-query.md)
- [Towards Natural Language-Based Visualization Authoring](https://refivu.com/papers/88bc5e0d-6a88-4600-80f8-23fec880ab8e-towards-natural-language-based-visualization-authoring.md)
- [Quantum Natural Language Processing on Near-Term Quantum Computers](https://refivu.com/papers/fe5936a3-c668-4b3d-809d-b9e9f3f18d2e-quantum-natural-language-processing-on-near-term-quantum.md)
- [Sentiment Analysis Based on Deep Learning: A Comparative Study](https://refivu.com/papers/01238de6-5a95-42bc-adff-3e5385ae4ea6-sentiment-analysis-based-on-deep-learning-a-comparative.md)
- [Synchronous Bidirectional Neural Machine Translation](https://refivu.com/papers/a9d42360-cea4-402b-be66-54c6fcbb997b-synchronous-bidirectional-neural-machine-translation.md)
- [Embedding Projection for Targeted Cross-Lingual Sentiment: Model Comparisons and a Real-World Study](https://refivu.com/papers/14ebfd4f-6ac8-4737-851d-03108b88fa3b-embedding-projection-for-targeted-cross-lingual-sentiment.md)
- [MorphIt: Flexible Spherical Approximation of Robot Morphology for Representation-driven Adaptation](https://refivu.com/papers/9d4f2447-925e-4c29-bb4c-c383d39c28b2-morphit-flexible-spherical-approximation-of-robot-morphology.md)
- [Investigating the fidelity of explainable artificial intelligence methods for applications of convolutional neural networks in geoscience](https://refivu.com/papers/6fc26172-2105-4bd7-b7b3-31bc6947ab05-investigating-the-fidelity-of-explainable-artificial.md)
- [Gait recognition via deep learning of the center-of-pressure trajectory](https://refivu.com/papers/e0d091d4-853d-4a49-b854-575d2b0c2a6f-gait-recognition-via-deep-learning-of-the-center.md)
- [Subgoal-based Reward Shaping to Improve Efficiency in Reinforcement Learning](https://refivu.com/papers/7cfae1a0-d6ce-434e-9208-ba670a0a87d0-subgoal-based-reward-shaping-to-improve-efficiency-in.md)
- [A Survey on Event-based News Narrative Extraction](https://refivu.com/papers/9d96c17c-77ac-4fdd-92e7-dc86acf73b67-a-survey-on-event-based-news-narrative-extraction.md)
- [Scalable Factor Graph-Based Heterogeneous Bayesian DDF for Dynamic Systems](https://refivu.com/papers/7803d9c1-9efe-47e4-b65f-fd1093c59baa-scalable-factor-graph-based-heterogeneous-bayesian-ddf-for.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/1572ef01-e606-4f6e-a992-4b353feb817a-short-text-classification-with-machine-learning-in-the)
