Roland KesziArtificial Intelligence &
Data Science Portfolio

On these pages I share the results of some of my data science and artificial intelligence based analysis projects.

Pages for higher education ↗

← All projects

From lexicons to large language models: a sentiment benchmark

Four generations of NLP on one task, classifying IMDb movie reviews as positive or negative: lexicon methods, neural networks, a fine-tuned BERT and zero-shot large language models from OpenAI, Anthropic and Google.

Data
IMDb movie reviews (50,000; 1,000-review random sample for LLMs)
Methods
VADER, TextBlob, CNN/LSTM with GloVe, BERT fine-tuning, zero-shot prompting
Tools
Python, Hugging Face, Keras, OpenAI / Claude / Gemini APIs

The question

Sentiment classification used to require hand-built word lists or models trained on thousands of labelled examples. Today a large language model can do it from a one-line instruction. How much better are the new models really, and is the largest model always the best choice?

Approach

Every model was evaluated with accuracy, precision, recall, F1 and a confusion matrix, followed by a qualitative review of every misclassified text.

Results

Accuracy of twelve sentiment models
Accuracy by model. The test sets differ between groups, so compare models within a group. *Gemini 2.5 Flash returned a valid label for only 634 of 1,000 reviews because of API errors.
Zero-shot LLMAccuracyPrecisionRecallF1Errors
GPT-5.3 Instant0.9690.9630.9730.96831
Claude Haiku 4.50.9620.9450.9770.96138
Claude Sonnet 4.60.9610.9470.9730.96039
GPT-4.1 mini0.9580.9540.9580.95642
Gemini 2.5 Flash-Lite0.9450.9530.9310.94255
Gemini 2.5 Flash (634 valid)0.9340.9580.9100.93342

What the numbers say

Reporting failures. API errors are part of the result. Gemini 2.5 Flash returned a valid label for only 634 of 1,000 reviews, and it is reported with that caveat rather than left out.

→ Notebooks on GitHub

Data: IMDb Large Movie Review Dataset (Maas et al., 2011).