Exploring emotions with Artificial Intelligence, OpenAI, and Exploratory Data Analysis | by Piero Paialunga | Dec, 2023

Here’s how visualize emotion in text with Python using OpenAI and Exploratory Data

Piero Paialunga
Towards Data Science
by author made using Midjourney

I want to start by saying that I am a fan of old Disney movies more than the new ones.

I think that has something to do with the fact that I was a kid when I watched older Disney movies and I have this feeling of nostalgia about the moment itself. Even if, by all means, I am not a expert, I also have the feeling that the old Disney movies are the ones with the best plots.

There is one remarkable exception though, and that is Inside Out. I watched that movie in the theater and was in love with it. I don’t want to spoil anything, I’ll say that the movie is about the idea that inside all of us there is a range of emotions:

  • Rage
  • Disgust
  • Joy
  • Fear
  • Sadness

And these emotions sometimes talk, like they are real people, inside of us. It’s an incredibly sweet movie with, I think, an amazing plot. When I heard that the new movie, Inside Out 2, is about to come out, I was so excited and I’m counting the days. 🙂

Now, let me anticipate your question:

“What does it have to do with AI?

When I was watching the trailer, I thought

“Can we generate what emotions would say?”
“Can we use the ChatGPT technologies to simulate what emotion “rage” would say if they were a person?”
“Can we explore emotions as vectors in a N dimensional space? And if that, can we plot it?

So buckle up, and let’s see what we can do 😏

Before we dive in, I want to highlight that this is a “ on the movie. I think that a where emotions are replaced by AI would be a pretty sad one, and I’m not claiming that the procedure will do any of that in the first place.

This story is divided into parts:

0. The structure of the
1. The first part of the code, generating emotions. High focus on the code
2. The second part of the…

Source link