Introduction
Irony is a sophisticated linguistic device where the intended meaning of a statement is the opposite of its literal interpretation. For Natural Language Processing (NLP) systems, detecting irony is a significant hurdle because it requires an understanding of context, sentiment, and subtle emotional cues. While irony detection has seen extensive research in English, the Portuguese language—often categorized as a "low-resource" language in the NLP community—presents unique challenges.
This paper summarizes the approach taken by the "BERT 4EVER" team for the IberLeF 2021 Irony Detection task. The challenge required participants to identify irony across two distinct domains: formal news articles and informal, noisy social media posts (tweets).
Methods and Training Strategies
The team utilized BERTimbau, a pre-trained version of the Bidirectional Encoder Representations from Transformers (BERT) model specifically optimized for the Portuguese language. To maximize the model's ability to distinguish ironic intent, the researchers implemented three primary training strategies:
- Domain-Specific Fine-tuning: Training independent models tailored specifically to either news or tweet datasets.
- Loss Weighting: Implementing a logarithmic class weight adjustment to account for class imbalance, preventing the model from defaulting to the majority class.
- Cross-Domain Merging (Strategy 3): Combining news and tweet data into a single training set to expose the model to a broader variety of ironic expressions and linguistic styles.
Finally, the team used Model Fusion, an ensemble technique that averages prediction probabilities from multiple models to enhance robustness.
Datasets and Class Imbalance
The study utilized the official IberLeF 2021 dataset, which highlighted a sharp contrast between the two target domains:
- News Field: 18,494 samples, heavily skewed toward "No Irony."
- Tweets Field: 15,212 samples, skewed toward "Irony."
This distribution flip is critical; while irony is relatively rare in structured news reporting, it is a dominant feature of social media discourse. The team noted that models must be carefully tuned to avoid simply "guessing" based on these statistical skews.
Key Results
The team's performance varied significantly between the two domains, illustrating the difficulty of cross-domain generalization in irony detection.
News Category Success
In the News category, the team secured 1st place on the competition leaderboard. Their most successful approach was Strategy 3 (Cross-Domain Merging), which achieved a Balanced Accuracy (Bacc) of 0.9215. Notably, the model demonstrated a high recall of 0.9565, indicating it was exceptionally effective at identifying ironic news stories without missing them.
The Social Media Challenge
Despite the success in news, the model struggled with the Tweets field, where performance dropped to a Bacc of 0.4975. Given that a Bacc of 0.50 represents random guessing, the researchers concluded that the model suffered from severe overfitting. While internal validation scores for tweets were nearly perfect (Bacc ~0.999), the model failed to generalize to the unseen test data, likely due to the chaotic syntax, slang, and brevity inherent in social media.
Discussion and Future Work
The "Generalization Paradox" observed in this study is particularly interesting: Strategy 3 performed worst on internal validation but best on the actual test set for news. This suggests that exposing the model to the "noisy" irony of tweets, while detrimental to validation scores, actually made the model more robust when encountering new, formal news data.
Future research will focus on techniques to combat overfitting in informal contexts. This includes exploring architectures better suited for linguistic noise and incorporating more diverse social media datasets to bridge the gap between structured and unstructured Portuguese text.
Summary updated