Proven Practice, Using ChatGPT-3 API for Sentiment Analysis

Can ChatGPT Serve as an Integrated API for Multilingual Sentiment Analysis? In my pursuit of understanding sentiment analysis (since when I was in my graduation and the term “Data Mining” was hot), I encountered the challenge of effectively integrating the analysis of multiple languages simultaneously.

The complexity escalated when attempting to process varied languages concurrently. To address this challenge, I conducted a personal study using the ChatGPT API (accessible via a subscription). The primary objective entailed parsing a Google Review dataset focused on a specific location: the Lisbon Airport in Portugal - spanning a single day.

Dataset

The proposed Google Reviews dataset provides a sample of approximately 50 reviews about Lisbon Airport, directly in the original language in which they were written. To aid understanding, ChatGPT is able to automatically translate the provided text.

Sample of the dataset:

  • You can download here.

Google Review Dataset

Requirements

To use these scripts, you will need the following:

  • Google account
  • Google Colab
  • API Key - OpenAI (free usage for 24h) or upgrade for paid plan.

Coding and Exploratory Review

data data data data data data data

Results

  • Impressive, the results demonstrated a huge level of accuracy on the all languages involved, surround English, Portuguese, Spanish, Italian, and even German (languages present within the dataset).
  • Notable is the fact that this process avoid the need for preliminary translation prior to engaging with the ChatGPT model. To outline the specifics, the dataset encompassed 50 (x3 execution) individual records.
  • The associated cost incurred for this analysis amounted to a mere $0.03, making this a cost-effective solution.

More