ai sentiment analysis poems

The featured image for this post was prompted using Stable Diffusion 1.5, or DALL-E, or Midjourney. All of these are AI models that allow you to turn your words into visual compositions. How great is that?

How To Analyze Sentiment In A Text Using ChatGPT

by

Music has healing power and is a fundamental part of my life, so I like to pick a “soundtrack” for every post I write. You are welcome to tune in with it and me 🙂

There are many ways in which Artificial Intelligence can assist us in understanding our emotions. To better understand how this could be applied, I asked ChatGPT for a literary and sentiment analysis of five poems I wrote some time ago. 

The idea is for you to take these examples as a starting point and find creative ways of using AI for self-discovery. For instance, if you keep a journal, you can ask ChatGPT to identify the primary emotions in your entries over a period of time. This is a great exercise to point out how specific events affect your mood, thoughts, and behavior. 

So, let’s take a look at how sentiment analysis works.

What Is Sentiment Analysis?

Also known as opinion mining, it is a natural language processing (NLP) technique to determine a text’s sentiment or emotional tone. The goal is to classify the content as positive, negative, or neutral based on the words and phrases used.

There are three primary categories in sentiment analysis:

  • Positive: When the text expresses a favorable opinion, emotion, or attitude.

  • Negative: When the tone indicates a critical or unfavorable opinion, emotion, or attitude.

  • Neutral: When the text does not express positive or negative sentiments. Instead, it is primarily factual or non-emotional.

Sentiment Analysis As A Self-Knowledge Tool

Now, let’s analyze some of my poems and see what we find. 

Poem 1

I have an urgency for you
An unheard-of need for your arms
and the hiding place in your rib,
which lulls me.
I want you to come back to me
I need you,
but you don’t plan to stay –I know–
so don’t come back. It’s better.
Don’t come back.

AI comment: This poem speaks of a deep longing and acceptance of an inevitable departure. The speaker expresses a desperate need for the subject yet acknowledges that the subject does not intend to stay. The plea for the subject not to return suggests a struggle between desire and self-preservation.


Poem 2

I opened the window
A little light warmed my soul.
How unexpected!
I let it stay, and she spent the night.
It seemed like years and long summers.
I don’t know when she began to fade
and vanished.
I closed the windows.
I’m cold again. 

AI comment: This poem captures a fleeting moment of warmth and comfort, symbolized by the unexpected light the speaker allows to stay. The passage of time is distorted, with a single night feeling like years and long summers. However, the light eventually leaves, and the speaker is left in cold loneliness once more, symbolizing a return to a state of emotional discomfort or distress.


Poem 3

She said: “I miss you”
and it was enough
to sweetly die.
How can I believe
such a thing when I am
rather ordinary?
My only virtue is my
stubbornness. 

AI comment: This poem explores a deep sense of self-doubt and disbelief in the face of affection. The speaker questions the sincerity of the subject’s expression of longing (“I miss you.”), considering themselves ordinary. The speaker’s stubbornness is presented as their only virtue, suggesting a struggle with self-perception and acceptance of others’ feelings.


Poem 4

Will anyone
see me
before my death?

AI comment: This poem is a poignant contemplation of the fear of being unseen and forgotten. The speaker questions whether they will be truly seen—perhaps not just physically, but emotionally and spiritually—before their death. It’s a stark expression of existential fear and the human desire for recognition and remembrance.


Poem 5

Please, try to survive me.
Do not give up
so fast on this
bittersweet thing
I am. 

AI comments: This poem is a plea for endurance and acceptance. The speaker acknowledges their complex nature (“this bittersweet thing I am”) and implores the subject not to give up on them. It’s a raw and honest expression of the fear of rejection and the desire for understanding and patience from others

How To Classify Emotions With Sentiment Analysis?

To establish the proportion of every sentiment across all poems, we must first identify each.

This table shows the predominant emotion at the beginning of every poem, followed by the prevailing sentiment at the end:

PoemBegins withEnds with
1LongingAcceptance
2ComfortLoneliness
3Self-doubtDisbelief
4FearDesire
5PleaAcceptance

Based on this, ChatGPT identified the following categories:

  1. Longing
  2. Acceptance
  3. Comfort
  4. Loneliness
  5. Self-doubt
  6. Incredulity
  7. Fear
  8. Desire
  9. Plea

Now, let’s count the frequency of each sentiment:

  1. Longing: Present in Poem 1.
  2. Acceptance: Present in Poems 1 and 5.
  3. Comfort: Present in Poem 2.
  4. Loneliness: Present in Poem 2.
  5. Self-doubt: Present in Poem 3.
  6. Incredulity: Present in Poem 3.
  7. Fear: Present in Poem 4.
  8. Desire: Present in Poem 4.
  9. Plea: Present in Poem 5.

Therefore, the proportion would be:

  1. Longing: 1 out of 9
  2. Acceptance: 2 out of 9
  3. Comfort: 1 out of 9
  4. Loneliness: 1 out of 9
  5. Self-doubt: 1 out of 9
  6. Incredulity: 1 out of 9
  7. Fear: 1 out of 9
  8. Desire: 1 out of 9
  9. Plea: 1 out of 9

This means that Acceptance is the most frequent emotion. However, we could group Self-doubt and Incredulity into the same category: Insecurity. We could also merge Longing and Desire.

So, with these adjustments, the predominant feelings across all poems would be:

  1. Insecurity.
  2. Acceptance.
  3. Longing

Embrace Vulnerability for Inner Empowerment

Exploring complex emotions may feel uncomfortable, but it’s a powerful resource that brings us closer to understanding ourselves better.

Accepting and celebrating our vulnerabilities makes us more empathic, allowing us to connect with others who are going through the same experiences. This way, we can become a source of comfort for those around us. 

It’s great to see how artificial intelligence can help us explore emotions like sadness and fear from a different angle, gaining a broader perspective on where these feelings come from.

Also, we can use this insight to work on mental constraints and build healthier core beliefs.

I hope this exercise has demonstrated the potential of AI to promote self-knowledge. Now, it’s your turn to give it a try.

Have a great day!


Tags: