Romanian Sentiment RNN

Overview
Developed a machine learning pipeline to perform binary sentiment classification (Positive / Negative) on a balanced dataset of over 17,000 Romanian text reviews. The project heavily emphasized language-specific preprocessing and a rigorous ablation study of Recurrent Neural Network (RNN) architectures to identify the most efficient model.
Data & Preprocessing Pipeline Working with informal, non-English text requires tailored natural language processing techniques. To handle the Romanian diacritics and colloquialisms, I built a custom pipeline:
- Implemented tokenization and lemmatization utilizing the
spaCylibrary (ro_core_news_smmodel). - Engineered a custom stop-word filter that selectively retained sentiment-critical words (e.g., "nu", "foarte", "rău", "bine") that standard libraries typically discard.
- Mapped the processed text sequences to 300-dimensional pre-trained FastText word embeddings to capture deep semantic relationships.
Methodology & Ablation Study
Rather than training a single model, I designed a FlexibleRNN class to systematically evaluate the performance impact of different architectural choices. I conducted an ablation study across 10 distinct configurations, testing:
- Cell Types: Long Short-Term Memory (LSTM) versus standard RNN cells.
- Directionality: Unidirectional versus Bidirectional sequence modeling.
- Network Depth: Ranging from 1 to 3 stacked layers.
- Optimizers: Comparing Adam, AdamW, and SGD.
Results & Insights
- Top Performance: The ablation study revealed that the most effective model was a streamlined 2-layer standard RNN utilizing the Adam optimizer. This configuration achieved an Accuracy of 84% and an F1-score of 0.8406.
- Key Finding: Interestingly, the simpler 2-layer RNN outperformed more computationally expensive models, such as a 3-layer BiLSTM. This highlighted that for this specific linguistic dataset, overly complex architectures were likely prone to overfitting or required longer training times without yielding proportional benefits.