Abstract
BERTweetFR is the first large-scale pre-trained language model specifically designed for French tweets. By performing domain-adaptive pre-training on a massive corpus of 226 million tweets, the model addresses the unique linguistic challenges of social media data, such as informal language, irregular abbreviations, and improper grammar. Evaluation on offensive language detection and named entity recognition tasks demonstrates that BERTweetFR significantly outperforms general-domain French models like CamemBERT and FlauBERT, providing a robust tool for French social media analysis.
Introduction
Standard Natural Language Processing (NLP) models are typically trained on "clean" text sources like Wikipedia, books, or news articles. However, social media data—specifically Twitter—is a different beast entirely. Tweets are characterized by informal language, irregular abbreviations, frequent typos, and a mix of languages. While models like BERTweet already existed for English, French lacked a dedicated large-scale model capable of handling the nuances of "Twitter-French." This gap makes it difficult for researchers to accurately perform sentiment analysis, detect hate speech, or extract entities from the French-speaking Twittersphere.
Methodology
The authors employed a strategy called domain-adaptive pre-training. Rather than training a model from scratch, they initialized BERTweetFR using the base architecture of CamemBERT, the state-of-the-art general-domain French language model (12 layers, 768 hidden dimensions, 110M parameters).
Key technical steps included:
- Normalization: Before training, user mentions and URLs were replaced with special tokens (
@USERandHTTPURL) to improve generalization. - Training Objective: The model utilized Masked Language Modeling (MLM), predicting 15% of masked tokens based on context.
- Optimization: The model was trained for 20 epochs over 8 days using 8 NVIDIA V100 GPUs.
Datasets
The study involved three distinct data efforts:
- Pre-training Corpus: A massive 16GB collection of 226 million deduplicated French tweets aggregated from the general Twitter Stream (2016–2019), a COVID-19 related corpus (2020–2021), and a socioeconomic analysis dataset (2014–2018).
- Offensive Language Dataset: The authors created and manually annotated a new dataset of 5,786 French tweets related to the COVID-19 pandemic, labeling them as offensive or non-offensive.
- NER Dataset: For evaluation, they used the existing CAp 2017 challenge dataset, containing 6,685 tweets annotated with 13 types of entities.
Key Results
BERTweetFR was compared against three strong baselines: CamemBERT, FlauBERT, and BARThez. It emerged as the clear winner in both downstream tasks, proving that domain-specific pre-training successfully helps the model understand the messy structure of tweets better than models trained on formal prose.
Offensive Language Identification
BERTweetFR achieved a significant performance boost in identifying offensive language, reaching an F1-score of 71.27 compared to CamemBERT’s 68.89.
Named Entity Recognition (NER)
In the NER task, BERTweetFR reached an F1-score of 62.77, outperforming general-domain models like CamemBERT (61.01) and FlauBERT (60.57).
Discussion and Conclusion
The success of BERTweetFR reinforces the idea that domain matters: even powerful general models struggle with the "noise" of Twitter. By exposing the model to 226M tweets, it learns the specific slang and structural quirks of the platform. Furthermore, the authors noted a rise in hateful sentiment toward the Asian community during the pandemic; their new offensive language dataset captures this phenomenon, making it a valuable tool for contemporary social science research.
While the pre-training corpus is substantial, future work could involve expanding the manually annotated datasets to further improve robustness. The authors have released the model on the Hugging Face model hub to encourage community development in French social media analytics.
Summary updated