Abstract
Recognition and classification of Figurative Language (FL) is an open problem of Sentiment Analysis in the broader field of Natural Language Processing (NLP) due to the contradictory meaning contained in phrases with metaphorical content. The problem itself contains three interrelated FL recognition tasks: sarcasm, irony and metaphor which, in the present paper, are dealt with advanced Deep Learning (DL) techniques. First, we introduce a data prepossessing framework towards efficient data representation formats so that to optimize the respective inputs to the DL models. In addition, special features are extracted in order to characterize the syntactic, expressive, emotional and temper content reflected in the respective social media text references. These features aim to capture aspects of the social network user's writing method. Finally, features are fed to a robust, Deep Ensemble Soft Classifier (DESC) which is based on the combination of different DL techniques. Using three different benchmark datasets (one of them containing various FL forms) we conclude that the DESC model achieves a very good performance, worthy of comparison with relevant methodologies and state-of-the-art technologies in the challenging field of FL recognition.
1. Introduction
Sentiment analysis in Natural Language Processing (NLP) typically relies on the literal interpretation of text. However, figurative language (FL)—including irony, sarcasm, and metaphor—presents a significant challenge because the intended meaning often contradicts the literal form. For instance, a sarcastic remark like "So many useless classes, great to be a student" uses positive descriptors ("great") to convey a negative sentiment. Standard models frequently fail to capture these subtle linguistic cues and emotional contradictions. This paper addresses these challenges by introducing the Deep Ensemble Soft Classifier (DESC), a framework that combines multiple deep learning architectures with specialized linguistic features to detect non-literal intent.
2. Methodology
The proposed DESC framework integrates three distinct neural architectures to capture different aspects of figurative language:
- BiLSTM (Bidirectional Long Short-Term Memory): This component captures sequential dependencies by processing text in both forward and backward directions, providing comprehensive context for each word.
- AttentionLSTM: This architecture enhances the BiLSTM by incorporating an attention mechanism. This allows the model to identify and "focus" on specific words that are most indicative of figurative intent, such as contradictory sentiment markers.
- Dense Neural Network (DNN): A six-layer fully connected network specifically designed to process 44 hand-crafted linguistic features. These features are categorized into syntactic (POS tags), demonstrative (emojis, punctuation), sentiment/mood (lexicon-based scores), and readability metrics.
2.1 Ensemble Strategy
The "secret sauce" of the DESC model lies in its feature engineering and ensemble approach. By calculating "sentiment contrast"—the difference between positive and negative lexicon scores—the model can effectively detect the emotional imbalance characteristic of sarcasm.
The final classification is performed using a "soft classification" ensemble strategy. Rather than a simple majority vote, DESC weights the confidence scores of the three sub-models (BiLSTM, AttentionLSTM, and DNN) based on their individual F1-performance during cross-validation.
3. Experimental Setup
The model was evaluated on three benchmark Twitter datasets:
- SemEval-2018 Task 3.A: A balanced dataset for irony detection (3,834 train / 784 test).
- Riloff Sarcasm Dataset: A highly imbalanced dataset (only 22% sarcastic) used to test robustness against real-world data distributions.
- SemEval-2015 Task 11: A dataset containing various FL forms ranked on an 11-point sentiment scale.
4. Results and Discussion
DESC consistently outperformed baseline models and state-of-the-art submissions from previous competitions. In irony detection (SemEval-2018), it achieved an F1-score of 0.73, outperforming the top five models reported in that task. On the imbalanced Riloff dataset, it reached an F1 of 0.87, demonstrating high reliability even when sarcastic examples are rare. For general sentiment analysis (SemEval-2015), DESC achieved a 0.82 cosine similarity score, significantly higher than the previous best of 0.758.
Key insights from the study include:
- Linguistic Style: Simple patterns like word length and lexicon variance are strong indicators of non-literal intent.
- Ensemble Synergy: No single model excelled across all tasks; the ensemble approach compensated for individual weaknesses (e.g., LSTMs missing structural cues vs. DNNs missing sequential context).
5. Conclusion
While DESC provides a robust solution for FL detection, future work could incorporate temporal context to track "past-present" contradictions and expand the training data beyond Twitter. Additionally, integrating deeper psychological patterns through tools like LIWC could further enhance the model's sensitivity to the nuances of figurative language.
Summary updated