HyperAIHyperAI

Command Palette

Search for a command to run...

il y a 3 ans

Prédiction d'emojis dans les tweets en utilisant BERT

Muhammad Osama Nusrat Zeeshan Habib Mehreen Alam Saad Ahmed Jamal

Mise en œuvre des bases de BERT avec PyTorch

20 heures de calcul sur RTX 5090 pour seulement $1 (valeur $7)
Aller à Notebook

Résumé

Titre :

Résumé : Ces dernières années, l'utilisation des emojis sur les réseaux sociaux a augmenté de manière spectaculaire, faisant d'eux un élément important pour la compréhension de la communication en ligne. Cependant, prédire le sens des emojis dans un texte donné constitue une tâche difficile en raison de leur nature ambiguë. Dans cette étude, nous proposons une approche basée sur les transformateurs pour la prédiction des emojis, en utilisant BERT, un modèle de langage pré-entraîné largement utilisé. Nous avons affiné (fine-tuned) BERT sur un grand corpus de textes (tweets) contenant à la fois du texte et des emojis, afin de prédire l'emoji le plus approprié pour un texte donné. Nos résultats expérimentaux démontrent que notre approche surpasse plusieurs modèles de pointe dans la prédiction des emojis, avec une précision supérieure à 75 %. Ce travail présente des applications potentielles en traitement automatique des langues, en analyse des sentiments et en marketing sur les réseaux sociaux.

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.


Créer de l'IA avec l'IA

De l'idée au lancement — accélérez votre développement IA avec le co-codage IA gratuit, un environnement prêt à l'emploi et le meilleur prix pour les GPU.

Codage assisté par IA
GPU prêts à l’emploi
Tarifs les plus avantageux

HyperAI Newsletters

Abonnez-vous à nos dernières mises à jour
Nous vous enverrons les dernières mises à jour de la semaine dans votre boîte de réception à neuf heures chaque lundi matin
Propulsé par MailChimp