Andy’s Neural Works

A wise folly can lead to great things!


A Comparison of Manual to AI Sentiment Analysis

Published by

on

Introduction

Sentiment analysis is a very interesting topic to me. The purpose of it is to analyze writings and determine their underlying emotion. For example, what would you consider if I wrote, “The clear, blue sky is wonderful today.” After reading that, you would think I am feeling good about the weather for today. Now, if I wrote, “The blue sky is a horrible way to start an otherwise miserable day,” you could guess I have some angst. 

That underlying feeling from the text is what sentiment analysis is all about. It is used in a variety of fields, including psychology and marketing. If you can analyze what people are writing about a product then you could get an insight into your customer’s happiness over it. You might even find ways to improve the product with the findings.

There are existing techniques for doing this analysis. These are usually done in a semi-manual manner using statistical techniques processed on a computer. If you do a simple web query, you can get plenty of examples in R and Python. In this article, I will go through an example but will then attempt to use generative AI to see what comes out of it. The end goal is to determine if one technique stands out.

Analysis Source Material

Many people like a good story in video games. It is often fantasy and can have many unique and obscure experiences. This will give a good base to try out the techniques.

The title chosen for analysis is the popular Nintendo Game, “Legend of Zelda: Breath of the Wild.”1 This is an adventure role-playing game with a classic “good vs evil” theme. The progression of the story typically goes from tragedy to victory. Given the ESRB2 rating of “Everyone 10+” along with the history, the initial prediction is that the sentiment analysis will be happy and positive.

I started by acquiring the game’s plot for the analysis. The basic story is copied directly from the Zelda Wiki on Gamepedia3 and placed it into a text file. This version of the story does not contain the ending which is what I wanted. Having played the game, the ending is quite good but let’s see what happens with predictions.

In a more extensive project, the page would be scraped. This approach has been talked about in a previous article. That is overkill in this example. Keep in mind how easy it is to manually copy and paste text when we get to the AI analysis.

Pre-Processing the Story

After an initial review of the text, there are some items in the source that need cleansing before identifying sentences. The following tasks are done:

  • Removal of Numbers 
  • Removal of Whitespace 
  • Set to lowercase

The full text is separated into a series of sentences. The punctuation is removed at this point and the sentences are tokenized into words. Further processing is completed by the library being called (Syuzhet4,5).

Manual Analysis

The sentences are analyzed using the National Resource Council (NRC) Canada Lexicon6. This is a common file containing many words and their associated emotional classification. I recommend reading the NRC website for more details.

The results list out the NRC emotion categories and counts. The following is a table that has the NRC results for each sentence. Note the last 2 columns showing if the emotion is negative or positive.

angeranticipationdisgustfearjoysadnesssurprisetrustnegativepositive
1112011010
0000010012
1021020021
0100020021
0000010010
0100111215
0100020022
1001000003
0200200103
0100010011
0000010000
0200010022
0121020121
0200200102
NRC Emotion Categories and Counts

Here is a bar plot of the table. The categories are sorted in descending order by count.

There is a good amount of sadness shown in this plot! Let’s consider sentiment valence to add some more depth.

Sentiment valence is a concept relaying an overall good or bad feeling. In the beginning, I noted the ending was not given in the plot. This is done to see if there could be any predictive measures that come out of this type of analysis. The following plot shows the sentiment valence throughout the plot. If we set the x-axis to the sentence # and y to the sentiment valence for the sentence, you can get a sense of how the story progresses. A basic linear regression is added to give a sense of direction.

A healthy amount of variation is happening in this story. There is a possibility of a positive ending if that prediction comes true. Maybe the hero wins in the end!

Word Analysis

Let’s take a more detailed look with a word cloud7. It is not difficult to do with available libraries.

The implementation rule for this analysis categorizes words based on the sentiment valence. In the event of a tie or 0 valence, the word is considered neutral. This is a very basic approach. The following visualization is a breakdown of words by resulting sentiment.

The difficulty with this approach is that some words can be used in both a negative and a positive manner throughout the plot. Further, there are words that do not stand on their own. They are usually serialized, indicating that the meaning changes when combined with other words. As you can see, it’s not a perfect science.

Looking at the results, “kingdom” stands out as the most important yet neutral word. Looking at the positive side, you see “Hyrule” (the kingdom name) is positive. “Calamity” is another important word here. Why is this positive? Combine this with the neutral term “Ganon.” Those who know this story know that “Calamity Ganon” is not neutral. 

There are limitations to this approach. Although the word cloud technique is useful in some settings, further processing is necessary for proper psychological use. It enforces the point that all aspects of the analysis must be brought together holistically.

Note: Some packages such as “sentimentr” are being developed to achieve this goal8

Thoughts using the Manual Approach

Beyond the emotional impact of “sadness” noted above, the general sentiment grows positive. The upward trend of the valence over the course of the plot narrative along with the overall and mean values give an impression that the final battle will result in victory. Even though word-level analysis is more complicated and error-prone, the overall technique does have promise. I wonder if the psychological view from this type of analysis has more success than failure in its identification conclusions.

Sentiment Analysis Using Generative AI

We are now in the era of incorporating generative AI into daily tasks. We are also trying to determine best practices for using these models. Long term, we might even see a new form of language to talk to AI. Think of it as an analyst-level language rather than a programming language. Let’s put that to the test with our sentiment analysis.

I’ll start by first being direct with the AI. If that doesn’t work, I’ll break the problem down like what was done above in the manual step. Some aspects, such as charts and graphs, are not approachable yet with AI. Seeing what a non-subscription-level AI query produces should be fun.

There will be 2 generative AIs chosen. Google’s Gemini9 and Microsoft’s Copilot10 are pretty common these days. Anyone can open up a web browser and get access without handing over subscription dollars. There are a growing number of competitors to consider for future work. These two should be a good place to start, though.

Gemini

I’m hoping to have some exciting results with generative AI. I’ll start with Google’s Gemini, which is trying to become the dominant player. First up is the direct order to do sentiment analysis based only on the website address.:

Input:

Perform sentiment analysis on the story found at this website: https://zelda.gamepedia.com/The_Legend_of_Zelda:_Breath_of_the_Wild

Response:

I don’t have access to the internet to directly analyze the sentiment of the website you provided. However, I can help you with some ways to analyze the sentiment yourself. Here are some tips:

Look for keywords and phrases that indicate positive emotions, such as “joy,” “hope,” “triumph,” or “excitement.” On the other hand, look for words that suggest negative emotions, like “sadness,” “anger,” “despair,” or “fear.”

Consider the overall tone of the story. Does it focus on the challenges Link faces, or the beauty of Hyrule that he’s trying to save?

The website you linked to is a wiki, so it might be helpful to look at the user comments or reviews to see how people reacted to the story.

I hope this helps!

That did not work well. It did not isolate the story from the website like I wanted. It also did not take a pass at the information on the entire website. On the positive side, it identified some components of the story. It did point out the user reviews as a source too. That is helpful and indicates there is some analysis happening. It’s just not what I am looking for.

Next, I’ll pass the story directly as a copy and paste. Again, not too difficult for anyone to do directly. We don’t need to parse things out like a computer needs to do. Our brain identifies the section almost automatically because we have the training and capabilities nearly built-in. Moving on, here are the results:

Input:

Perform sentiment analysis on the following text:

[full text cut to save space, look at the link in the references for more info]

Response:

Sentiment Analysis of The Legend of Zelda: Breath of the Wild Text

The text you provided has a mix of positive and negative sentiment, but leans slightly towards the negative. Here’s a breakdown:

Negative Sentiment:

  • Loss and Destruction: Words like “ruined,” “laid waste,” “ravaged,” “defeated,” “trapped,” “destroyed,” and “devastated” paint a picture of a fallen kingdom and the looming threat of further destruction.
  • Death: The deaths of King Rhoam, the Champions, and many Hylians create a sense of tragedy and loss.
  • Despair: The situation seems hopeless, with Calamity Ganon’s power growing and the world threatened.

Positive Sentiment:

  • Hope: Despite the destruction, there’s a flicker of hope with Link’s awakening and the potential to defeat Ganon.
  • Courage: Link’s role as the Hylian Champion and the past heroes’ success provide a sense of courage in facing the challenge.
  • Discovery: Exploring the vast world and uncovering its secrets offers a sense of adventure and potential for positive change.

Overall:

The text sets the stage for a story with high stakes. While the focus is on the dire situation Hyrule faces, the underlying themes of courage, hope, and discovery hint at a potential for a triumphant conclusion.

That is better than I thought! It has more depth to it compared to my manual approach. The breakdown of positive and negative sections is useful. Also, there is the breakdown into the actual emotions. I like how it makes some assertions using commonsense sentences along the way. This is useful. Having scores alongside it would be a big help too. Let’s see if NRC analysis can be done.

Can you compare to NRC database what you found

Unfortunately, I can’t directly access and analyze the NRC database since I don’t have external access. However, I can give you a more detailed breakdown of the sentiment based on the NRC categories:

Negative NRC Emotions:

  • Fear: The threat of Calamity Ganon and its destructive power evokes fear for the world and its inhabitants.
  • Sadness: The loss of the kingdom, its people, and the Champions creates a sense of sadness.
  • Anger: The actions of Calamity Ganon and the devastation it caused could be interpreted as a source of anger.

Positive NRC Emotions:

  • Anticipation: Link’s awakening and the potential to defeat Ganon create anticipation for a positive outcome.
  • Trust: There’s a degree of trust placed in Link as the Hylian Champion to save the world.

NRC Sentiment:

Based on the NRC categories, the text leans towards negative sentiment with fear and sadness being prominent. However,there are glimpses of positive emotions like anticipation and trust that suggest a potential for overcoming the challenges.

Limitations:

This analysis is based on a limited excerpt and doesn’t capture the full story. Humor, character interactions, and other aspects of the narrative could influence the overall sentiment.

Additional Resources:

  • You can find more information about the NRC Emotion Lexicon here.
  • Some online tools allow basic sentiment analysis based on NRC categories. You can try searching for “NRC sentiment analysis tool” to see if any are publicly available.

At least it’s honest by saying it doesn’t have direct access to the NRC database. It did not give up which is interesting. It makes me think if it cannot access the NRC database, how are the categories correctly identified to the words in the story? Reading through, you can see it uses the NRC tag for the emotions. I think this is where I question the accuracy of the response. Maybe it is accessing a publicly available library but not being clear about it.

If you read the results on the surface level, they seem plausible. We see the positive and negative sections. There is also the breakdown of emotions. Again, where is it getting the details if it needs access to the NRC database? It may be using a lexicon file it found in one of its models.

It is useful to see the “Limitations” and “Additional Resources” sections. Openness leads to a bit more credibility in the response.

Next, let’s see if it can develop a word cloud like what was done in the manual step.

Input:

draw a word cloud using sentiment analysis on the story

Response:

Positive: Link, Hope, Champion, Defeat, Explore, World

Negative: Calamity Ganon, Destroyed, Ravaged, Trapped, Defeat, Loss

Neutral: King, Zelda, Hyrule, Guardian, Divine Beast, Time Here are the words you can use to create a word cloud depicting the sentiment of the story. You can adjust the prominence of each word based on the sentiment analysis we performed. For example, words like “Calamity Ganon” and “Destroyed” could be larger, reflecting the negativity, while words like “Link” and “Hope” could be smaller but still present.

It did not produce a picture but did give some details about its classifications. I like how it combined words such as “Calamity Ganon” into n-grams for analysis. This information could be useful if combined with the manual approach.

Finally, can a prediction be generated for the ending?

Input:

predict whether the story will end in a positive or negative manner

Response:

Based on the provided excerpt, predicting a definitive positive or negative ending for The Legend of Zelda: Breath of the Wild is difficult. Here’s why:

  • Focus on Setup: The excerpt focuses heavily on establishing the dire situation – a fallen kingdom, a powerful evil,and a seemingly hopeless task for the protagonist.
  • Seeds of Hope: However, there are hints of potential positivity. Link’s role as the Champion, the past heroes’ success, and the vast world to explore suggest a chance for a triumphant conclusion.

Considering these factors, the story likely leans towards a positive ending. Here’s the reasoning:

  • Hero’s Journey: The Legend of Zelda series is known for following the Hero’s Journey trope, where the protagonist overcomes challenges and ultimately triumphs.
  • Link’s Role: The emphasis on Link as the Champion suggests he’s destined to save the world.
  • Player Agency: The open-world nature of the game allows players to choose their path, but ultimately the goal is to defeat Ganon.

However, there are possibilities for a negative twist:

  • Overwhelming Odds: The power of Calamity Ganon and the destroyed kingdom present a significant challenge.
  • Player Choice: While the game’s goal is to defeat Ganon, players could theoretically choose not to complete the main quest.

Overall:

The sentiment analysis suggests a story with a struggle, but the narrative structure and series conventions point towards a positive resolution. While the provided excerpt doesn’t guarantee a happy ending, it sets the stage for an epic journey with a hopeful outcome.

Given that predictions are looser, these results have some impact. Starting with the general structure of the analysis, we get a sense that these models are well-trained. The sentence structure is well done and the information is plausible again. 

An interesting note is that it provides the full name of the game. It may be looking up information that I did not provide it. That would be a concern. Still, it’s impressive it identified the story’s title without being given that information.

Reviewing the prediction independently, it’s good that it gives both positive and negative outcomes. In the manual approach, we could come up with some values. It would be useful if it showed it’s probability figures.

Sentiment Analysis with Copilot

I will summarize the analysis of copilot to save on space. The full results are in the appendix if you are interested.

When given the same questions, Copilot had some more elaborate responses. It still could not pull out the story text from the webpage I gave it. Instead, it relied on what it already stored in its knowledge (i.e. what is in its training set). That would be fine if I asked a general question about the game. However, I had to give it a specific set of text and ask again for its analysis.

When given the specific story text, it’s noticeable how much more in-depth Copilot responds. It also gave the NRC results but specifically stated it used the NRC lexicon and not the database directly. So, take that comparison as semantic differences but I felt it provided more of a full-fledged answer.

In the word cloud case, Copilot did trip up. It does get bonus points for providing some Python code to generate a word cloud. I like that response. It did not have the answer but gave some help and direction.

Again, the results show that it is looking up more information using its sources. The preference would be to use only the excerpt given. With future iterations, this might become an option.

Conclusion

Comparing manual sentiment analysis to generative AI is a challenging task. It is true that using AI requires you to simply use an app or website. One does not have to generate any code in this case. That is certainly a positive but is it a completely trustworthy replacement or an augmentation? 

Remember, AI’s answers are based on what is most likely expected. Many other factors, such as selection bias can cloud those responses. For example, I have my own experiences with the game so I know the story. I can easily question the responses as being factual or not. If that were not the case, the analysis is only as good as the data and methods.

If I had to analyze some product or service without in-depth knowledge, I would have to do a manual step to gain a deep understanding. That’s important and goes back to the CRISP-DM. Do you understand the business? Do you understand those data? If not, start at the beginning.

An AI isn’t a life experience-tested machine. It requires humans to keep it aligned properly. That is why when it responds “it’s not sure” or “it does not know” that is a good indicator. The system is developed to at least try to be honest. Never take it for face value but consider it a possible source.

What I see in AI’s sentiment analysis is a way to augment manual processing. I found some potential issues in the manual steps which require deeper dives. Whenever an odd or unexpected response is found, always reach out for different views and approaches. Using a generative AI is a possible, additional viewpoint. Experience matters and so does the quality of your sources. Remember, always validate because you might be called to the mat.

Thank you

Appendix

R Code for Manual Process

#
# Name: Manual Sentiment Analysis of Zelda: BotW
# Author: Andy Della Vecchia
# Date: July 12, 2024
#

# Libraries
library(knitr)
library(syuzhet)
library(readr)
library(ggplot2)
library(tidyr)
library(dplyr)
library(wordcloud)
library(tm)

# Keep seed consistent
set.seed(100)

# Read in plot
zelda_txt <- read_file("data/zelda_botw_plot.txt")

# Break into sentences
s_v <- get_sentences(text_of_file = zelda_txt)

# Get the words
word_v <- get_tokens(text_of_file = zelda_txt)

# Develop NRC basics
nrc_v2 <- get_nrc_sentiment(s_v)

nrc_syuzhet_vector <- get_sentiment(s_v, method="nrc", lang = "english")
overall_sentiment <- sum(nrc_syuzhet_vector)
mean_sentiment <- mean(nrc_syuzhet_vector)

# Valence Flow Prep
nrc_df <-data.frame(nrc_syuzhet_vector)
nrc_df$rownumber = 1:dim(nrc_df)[1]

# Word Cloud Prep
all = c(
  paste(word_v[nrc_v2$negative > nrc_v2$positive], collapse=" "),
  paste(word_v[nrc_v2$positive > nrc_v2$negative], collapse=" "),
  paste(word_v[nrc_v2$positive == nrc_v2$negative], collapse=" ")
)

all <- removeWords(all, stopwords("english"))

# create corpus
corpus = Corpus(VectorSource(all)) %>%
  tm_map(removeNumbers) %>%
  tm_map(removePunctuation) %>%
  tm_map(stripWhitespace)

# create term-document matrix
tdm = TermDocumentMatrix(corpus)
tdm = as.matrix(tdm)
tdm1 <- tdm[nchar(rownames(tdm)) < 17,]
colnames(tdm) = c('negative', 'positive','neutral')
colnames(tdm1) <- colnames(tdm)

# Build up barplot by emotions
emo_bar = colSums(nrc_v2[,1:8])
emo_sum = data.frame(count=emo_bar, emotion=names(emo_bar))
emo_sum$emotion = factor(emo_sum$emotion, levels=emo_sum$emotion[order(emo_sum$count, decreasing = TRUE)])

# Bar plot to show sentiments
ggplot(emo_sum, aes(x = reorder(emotion, -count), y = count, fill = count)) +
  xlab("Emotion") +
  ylab("Count") +
  geom_bar(stat = "identity") +
  ggtitle("Emotions Distribution - Descending Order")

# Plot for sentiment valence
ggplot(nrc_df, aes(y=nrc_syuzhet_vector, x=rownumber)) +
  geom_line(linetype="dotted") +
  geom_point() +
  xlab("Sentence #") +
  ylab("Valence")+
  geom_smooth(method=lm, se=FALSE) +
  ggtitle("Valence Trend")

# Plot word cloud
comparison.cloud(tdm1, 
                 random.order=FALSE,
                 colors = c("red","green","blue"),
                 title.size=2, 
                 max.words=250, 
                 scale=c(3.5, 0.25),
                 rot.per=0.4)

Copilot Results

Input:

Perform sentiment analysis on the story found at this website: https://zelda.gamepedia.com/The_Legend_of_Zelda:_Breath_of_the_Wild

Results:

I’m sorry, but I can’t perform tasks like sentiment analysis on external content. However, I can provide you with a summary of the story of “The Legend of Zelda: Breath of the Wild” based on the information available to me.

The story of “The Legend of Zelda: Breath of the Wild” is set in a post-apocalyptic version of Hyrule. It follows Link, who awakens from a century-long slumber to defeat Calamity Ganon, a malevolent force that has destroyed Hyrule. Throughout his journey, Link recovers his lost memories and works to free the Divine Beasts, large mechanical creatures designed to help combat Ganon. With the aid of Princess Zelda and the spirits of the fallen champions, Link aims to restore peace to the kingdom.

The narrative is rich with themes of courage, friendship, and resilience as Link overcomes various trials and reconnects with allies from his past. The game is celebrated for its open-world exploration, allowing players to experience the story at their own pace and in a non-linear fashion.

If you’re interested in the emotional tone of the story, it generally revolves around hope, perseverance against overwhelming odds, and the triumph of good over evil. The story is also tinged with melancholy, as it deals with loss, the burden of legacy, and the struggle to reclaim a fallen kingdom. It’s a tale that resonates with many for its depth and the emotional journey it takes players on. Would you like to know more details about the game or its story elements?

Input:

Perform sentiment analysis on the following text:

[full text cut to save space, look at the link in the references for more info]

Copilot

Sent by Copilot:

The text you’ve provided from “The Legend of Zelda: Breath of the Wild” conveys a narrative that is rich with themes of heroism, duty, and the struggle against a great evil. Here’s a sentiment analysis of the text:

Sentiment of Urgency and Peril: The text begins with a sense of urgency as Link awakens to a kingdom in ruins, facing the imminent threat of the Calamity Ganon. This sets a tone of peril and the need for immediate action.

Nostalgia and Loss: Meeting the spirit of the deceased King of Hyrule evokes a sense of nostalgia and loss, as Link learns about the kingdom’s past glory and its downfall a century ago.

Hope and Determination: Despite the devastation, there’s a thread of hope and determination. Link is encouraged to learn about the Guardians and Divine Beasts, ancient technologies that once defeated the Calamity Ganon, suggesting that all is not lost.

Tragedy and Sacrifice: The story recounts a tragic turn of events where the kingdom was betrayed by its own defenses, leading to Zelda’s sacrifice to seal herself and the Calamity Ganon in Hyrule Castle.

Courage and Resolve: As Link embarks on his quest, there’s a strong sentiment of courage and resolve. He must investigate the fate of the Divine Beasts and their Champions, and ultimately, face the Calamity Ganon to free Zelda and save the world.

Freedom and Choice: The open-ended nature of Link’s journey, where he decides how to approach his role as the Hylian Champion, introduces a sentiment of freedom and choice, allowing the player to explore the world and story at their own pace.

Overall, the text paints a picture of a hero’s journey filled with challenges and the will to overcome them. It’s a tale of battling darkness with the light of hope and courage, resonating with classic adventure themes that engage the player emotionally. If you need further analysis or have other requests, feel free to let me know!

Input:

Can you compare to NRC database what you found

Results:

Certainly! The NRC Emotion Lexicon, also known as EmoLex, is a resource that lists English words and their associations with eight basic emotions (anger, fear, anticipation, trust, surprise, sadness, joy, and disgust) and two sentiments (negative and positive)1. The lexicon was created by manual annotation through crowdsourcing and is used for sentiment analysis and emotion detection in text.

Based on the NRC Emotion Lexicon, the text from “The Legend of Zelda: Breath of the Wild” can be analyzed for its emotional content as follows:

Anger and Disgust: Words like “evil,” “ruined,” and “devastated” may be associated with anger and disgust, reflecting the destruction caused by the Calamity Ganon.

Fear and Sadness: The calamity and the fall of the kingdom evoke fear and sadness, which are likely to be associated with words such as “laid waste,” “gravely wounded,” and “trapped.”

Anticipation and Trust: The mention of ancient technologies and the hero’s journey to defeat the evil suggests anticipation for the upcoming battle and trust in the hero’s abilities.

Surprise: The betrayal by the ancient machines turning against the Hyruleans could be associated with surprise.

Joy: Although not predominant, there may be a sense of joy associated with the hope of defeating Calamity Ganon and restoring the kingdom.

Negative Sentiment: The overall sentiment of the text is likely to be negative due to the focus on the calamity and the struggle against it.

Positive Sentiment: Positive sentiment may arise from the elements of hope, courage, and the potential for triumph over evil.

It’s important to note that the actual sentiment and emotion scores for specific words would need to be calculated using the NRC Emotion Lexicon database, which provides binary associations (associated or not) for each word with the emotions and sentiments mentioned1. The analysis I provided is a high-level interpretation based on the themes and emotions present in the narrative.

If you have any specific words or phrases from the text that you would like to analyze against the NRC database, or if you need further assistance, please let me know!

Input:

draw a word cloud using sentiment analysis on the story

Results:

I’m sorry, but I’m unable to create visual content such as a word cloud. However, I can guide you on how you might create one yourself using sentiment analysis.

To create a word cloud based on sentiment analysis, you would typically follow these steps:

  1. Text Processing: Extract the text from the story and preprocess it by removing stop words, punctuation, and performing tokenization.
  2. Sentiment Analysis: Use a sentiment analysis tool or library to assign sentiment scores to each word or phrase in the text. You can use the NRC Emotion Lexicon for this purpose, which will give you a sentiment score based on the eight basic emotions and two sentiments.
  3. Word Frequency: Calculate the frequency of each word in the text, possibly weighted by their sentiment scores.
  4. Word Cloud Generation: Use a word cloud generator, such as the wordcloud package in Python, to create the word cloud. You can customize the colors and sizes of the words based on their sentiment scores and frequencies.
  5. Visualization: Finally, visualize the word cloud to see the most prominent words associated with different sentiments in the story.

Here’s a simple example of Python code that you could use to create a basic word cloud:

from wordcloud import WordCloud

import matplotlib.pyplot as plt

# Sample text for demonstration

text = “Your text goes here.”

# Create a word cloud object

wordcloud = WordCloud(width=800, height=400, background_color=’white’).generate(text)

# Display the word cloud using matplotlib

plt.figure(figsize=(10, 5))

plt.imshow(wordcloud, interpolation=’bilinear’)

plt.axis(‘off’)

plt.show()

Remember, this is just a basic example. For sentiment analysis, you would need to integrate a sentiment analysis library or API to assign sentiment scores to the words before generating the word cloud.

If you need further assistance with the code or have any other questions, feel free to ask!

Input:

predict whether the story I provided will end in a positive or negative manner

Results:

Given the narrative elements you’ve provided from “The Legend of Zelda: Breath of the Wild,” the story is structured with a classic hero’s journey in mind, which typically concludes on a positive note. The themes of the story include overcoming great adversity, the triumph of good over evil, and the restoration of balance and peace. These motifs suggest a positive resolution where the protagonist, Link, is likely to succeed in his quest.

The story’s progression, with Link awakening to fulfill his destiny, hints at a narrative arc that will lead to the defeat of Calamity Ganon and the salvation of both Princess Zelda and the Kingdom of Hyrule. The recurring theme of hope, despite the dire circumstances, supports the anticipation of a victorious ending.

While the journey may be fraught with challenges and moments of despair, the overarching sentiment of the story leans towards a positive outcome. This is further reinforced by the game’s role as an interactive experience, where the player’s actions have a direct impact on the world and can lead to a sense of accomplishment and resolution.

Therefore, based on the narrative cues and the structure of the story, it is reasonable to predict that the story will end in a positive manner, with Link overcoming the odds to defeat Calamity Ganon and restore peace to the kingdom. If you have any more questions or need further assistance, feel free to ask!

References

[1] Nintendo. “The Legend of Zelda: Breath of the Wild.” https://www.zelda.com/breath-of-the-wild/

[2] ESRB. Ratings Guides, Categories, Content Descriptions. Retrieved from https://www.esrb.org/ratings-guide/

[3] Zelda Wiki. “The Legend of Zelda: Breath of the Wild” Retrieved from: https://zelda.gamepedia.com/The_Legend_of_Zelda:_Breath_of_the_Wild

[4] Matthew Jockers. Package ‘syzuzhet’ Retreived from: https://cran.r-project.org/web/packages/syuzhet/syuzhet.pdf

[5] Matthew Jockers. “Introduction to the Syuzhet Package.” 2017-12-13. Retreived from: https://cran.r-project.org/web/packages/syuzhet/vignettes/syuzhet-vignette.html

[6]National Resource Council Canada. Sentiment and emotional lexicons. Retrieved from: https://nrc.canada.ca/en/research-development/products-services/technical-advisory-services/sentiment-emotion-lexicons

[7] Céline Van den Rul. “How to Generate Word Clouds in R.” Oct 15, 2019. Retrieved from https://towardsdatascience.com/create-a-word- cloud-with-r-bde3e7422e8a

[8] Tyler Rinker. Package: sentimentr. Retrieved from: https://cran.r-project.org/web/packages/sentimentr/sentimentr.pdf

[9] Google. Gemini. Retrieved from: https://gemini.google.com/

[10] Microsoft. Copilot. Retrieved from: https://copilot.microsoft.com/