HyperAIHyperAI

Command Palette

Search for a command to run...

3년 전

BERT를 사용한 트윗에서의 이모지 예측

Muhammad Osama Nusrat Zeeshan Habib Mehreen Alam Saad Ahmed Jamal

PyTorch 를 사용한 BERT 기초 구현

노트북으로 이동

초록

요즘 몇 년간 소셜 미디어에서 이모지 사용이 급격히 증가하여 온라인 커뮤니케이션을 이해하는 데 중요한 요소가 되었습니다. 그러나 이모지의 모호한 특성으로 인해 주어진 텍스트에서 이모지의 의미를 예측하는 것은 어려운 과제입니다. 본 연구에서는 널리 사용되는 사전 학습된 언어 모델인 BERT를 활용하여 이모지 예측을 위한 트랜스포머 기반 접근 방식을 제안합니다. 우리는 텍스트와 이모지가 모두 포함된 대규모 텍스트 코퍼스(트윗)에서 BERT를 파인튜닝하여 주어진 텍스트에 가장 적합한 이모지를 예측했습니다. 실험 결과는 우리의 접근 방식이 75% 이상의 정확도로 이모지를 예측하는 데 있어 여러 최신 모델보다 우수한 성능을 보임을 입증합니다. 본 연구는 자연어 처리, 감정 분석 및 소셜 미디어 마케팅 분야에서 잠재적인 응용 가능성을 지니고 있습니다.

One-sentence Summary

This study fine-tunes BERT on a large tweet corpus to predict the most appropriate emoji for a given text, achieving over 75 percent accuracy that outperforms several state-of-the-art models and demonstrating potential applications in natural language processing, sentiment analysis, and social media marketing.

Key Contributions

  • A transformer-based framework adapts a pre-trained BERT architecture to model contextual dependencies between social media text and emoji usage.
  • The model is fine-tuned on a large-scale tweet corpus to predict the most contextually appropriate emoji for ambiguous textual inputs.
  • Experimental results demonstrate that the approach outperforms multiple state-of-the-art baselines with over 75 percent accuracy, while quantifying how training data scale and emoji vocabulary size affect prediction performance.

Introduction

The widespread adoption of emojis in social media has made accurate emoji prediction a valuable tool for clarifying ambiguous text and advancing applications in natural language processing and sentiment analysis. Prior research has primarily relied on transformer architectures like BERT, yet these models face significant hurdles due to the scarcity of large, culturally diverse training datasets, which limits their cross-linguistic generalization. The authors leverage a fine-tuned BERT architecture trained on a large-scale tweet corpus to predict contextually appropriate emojis, demonstrating that their method achieves over seventy-five percent accuracy while surpassing several established baselines.

Dataset

  • Dataset Composition and Sources: The authors use two CSV-formatted tweet datasets hosted on Kaggle to train and evaluate their emoji prediction model.
  • Subset Details:
    • Dataset 1 contains 188 tweets split into 132 training and 56 testing samples across 5 emoji classes.
    • Dataset 2 comprises 95,752 tweets divided into 69,832 training and 25,920 testing samples across 20 emoji classes. Both subsets include supplementary Mapping and Output CSV files to manage emoji-to-label encoding and unique ID tracking.
  • Training Strategy and Usage: Both datasets follow a strict 70:30 train-to-test split. The authors implement a two-phase training pipeline where the model first adapts to Dataset 1 for initial setup, then fine-tunes on the larger Dataset 2 to enhance accuracy and exposure to diverse emoji patterns.
  • Processing and Metadata: Data preparation focuses on structured CSV formatting and systematic label mapping rather than image cropping or complex metadata extraction. The authors convert raw emoji labels into coded formats using the Mapping file and assign unique identifiers to streamline batch processing and model ingestion.

Method

The authors leverage a structured pipeline for developing a natural language processing (NLP) model based on a neural network architecture, as illustrated in the framework diagram. The process begins with dataset collection, where a representative sample of text and emoji pairs is gathered to train and evaluate the model. The quality and diversity of this dataset are critical for ensuring the model's performance and generalization capabilities. Following data collection, preprocessing is applied to cleanse the raw text, which often contains noise, inconsistencies, and irrelevant elements. This step includes standard NLP operations such as converting text to lowercase, removing punctuation, handling special characters, and addressing missing values. Additionally, stemming is performed to reduce words to their root forms using the Natural Language Toolkit (NLTK), which helps standardize vocabulary and improve model efficiency. The impact of stemming on model performance is evaluated as part of the experimental design.

Tokenization and embedding follow preprocessing, where the cleaned text is broken into discrete units—tokens—typically words. Each token is then mapped to a numerical index, and subsequently transformed into a high-dimensional vector representation that captures semantic and contextual relationships. These embeddings serve as the input to the neural network, enabling the model to process textual data effectively. The core component of the model is a fine-tuned BERT architecture, which is pre-trained on large-scale language corpora to learn general linguistic patterns and contextual dependencies. BERT’s bidirectional training mechanism allows it to analyze the full context of each word in a sentence, enhancing its understanding of language structure. This pre-trained model is then fine-tuned on the specific emoji prediction task, adapting its parameters to the target domain and improving accuracy in multi-emoji classification.

The final stages involve model evaluation and inference. After fine-tuning, the model is assessed on training, validation, and test datasets using standard evaluation metrics to measure performance. The trained model is then deployed for inference, where it processes new, unseen text inputs and generates predictions for relevant emoji outputs. This end-to-end workflow ensures that the model is both robust and adaptable to real-world applications.

Experiment

The evaluation setup utilized a fine-tuned BERT model integrated with a dense network, assessing emoji prediction capabilities across two distinct tweet datasets through standard classification metrics and training loss trajectories. These experiments validated the model's ability to generalize across varying data distributions while confirming its superior capacity to learn intricate linguistic features compared to traditional baselines. Qualitative analysis further demonstrated that predictive robustness was significantly enhanced by targeted preprocessing and the integration of tweet-specific contextual elements. Ultimately, the study establishes fine-tuned BERT as a highly effective framework for emoji prediction, offering substantial utility for social media monitoring and sentiment analysis applications.


AI로 AI 구축

아이디어에서 출시까지 — 무료 AI 코코딩, 즉시 사용 가능한 환경, 최적의 GPU 가격으로 AI 개발을 가속화하세요.

AI 협업 코딩
바로 사용 가능한 GPU
최적의 가격

HyperAI Newsletters

최신 정보 구독하기
한국 시간 매주 월요일 오전 9시 에 이번 주의 최신 업데이트를 메일로 발송합니다
이메일 서비스 제공: MailChimp