Sentiment Analysis Showdown: ChatGPT vs. Traditional ML NLP Methods

Courtlin Holt-Nguyen
Artificial Corner
Published in
6 min readMay 22, 2023

--

Image: Photo by Gratisography

Introduction

ChatGPT is a powerful tool for any data science task that requires natural language processing and natural language understanding. How does ChatGPT compare to traditional machine learning NLP techniques for sentiment analysis? In this article I’ll present a comparison of ChatGPT vs. 7 traditional machine learning models (before and after hyperparameter tuning) and let you see why ChatGPT is such a powerful sentiment analyzer.

ChatGPT Background

ChatGPT is Open AI’s large language model. Most people are familiar with it through the chat interface at chat.openai.com. However, if you have a paid account with Open AI, you can access the ChatGPT API via Python as I did for the following experiments. Although you do have to pay to use the ChatGPT API, the cost is minimal and based on usage; I spent less $0.60 USD testing hundreds and hundreds of reviews for this article.

The Dataset

For this article, I will use the IMDB Large Movie Review Dataset of 50,000 labeled reviews provided by Andrew Maas et al at Stanford in their paper, Learning Word Vectors for Sentiment Analysis. Here’s the link to the dataset website. http://ai.stanford.edu/~amaas/data/sentiment/

--

--

Courtlin Holt-Nguyen
Artificial Corner

Former Head of Enterprise Analytics. I share practical data science tutorials with working code. Data scientist | data strategist | consultant.