From TF-IDF to Transformers: A Comparative and Ensemble Approach to Sentiment Classification

· Source: cs.CL updates on arXiv.org · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Data Science & Analytics, Natural Language Processing · Depth: Advanced, long

Summary

This study presents a comparative and ensemble approach to sentiment classification using the IMDb dataset, comprising 50,000 movie reviews. Researchers evaluated diverse machine learning models, including Naïve Bayes, Logistic Regression, Support Vector Machines (SVM), LightGBM, LSTM, and transformer-based models like RoBERTa and DistilBERT. Data preprocessing involved text normalisation, tokenisation, and TF-IDF vectorization for traditional models, while transformers utilized subword tokenisation and contextual embeddings. RoBERTa achieved the highest individual accuracy at 93.02%. A soft voting ensemble, combining all models with equal weights, further enhanced classification performance, reducing misclassification rates for sarcastic reviews by approximately 23% and showing a 1-3% improvement across metrics compared to RoBERTa alone. The study also employed SHAP for model explainability, attributing predictions to specific tokens.

Key takeaway

For Machine Learning Engineers building sentiment analysis systems, you should prioritize transformer-based models like RoBERTa for maximum accuracy, especially with complex language. To significantly improve robustness and handle nuanced cases like sarcasm, integrate a soft voting ensemble of diverse models. Consider DistilBERT if computational efficiency is a key constraint, as it offers strong performance. Your approach should also include SHAP for crucial model transparency.

Key insights

A soft voting ensemble of diverse machine learning and transformer models significantly enhances sentiment classification accuracy, particularly for nuanced text.

Principles

Method

Text was preprocessed with normalisation, tokenisation, and TF-IDF or subword tokenisation. Seven diverse models (traditional ML, LSTM, transformers) were trained, and their probability predictions were combined via a soft voting ensemble. SHAP explained predictions.

In practice

Topics

Best for: AI Engineer, Research Scientist, AI Scientist, Machine Learning Engineer, NLP Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by cs.CL updates on arXiv.org.