Assignment 7

Author

Joshua Bielski

Assignment 7

I’m about to dive into the Bengals’ season reviews from 2010 to 2019 on Wikipedia. My hunch is that things might kick off positively but take a downturn as the Bengals encounter some tough patches. I’m genuinely intrigued by the emotions these reviews convey—my bet is on a fair share of negativity, with shades of sadness and surprise. Some of those years probably didn’t live up to expectations, hence my anticipation. What really piques my interest is the disparity: the Bengals performed admirably in the regular season, yet when it came to the playoffs, luck seemed to elude them. This repeated disappointment likely shapes the overall negative tone of the reviews.

My plan involves visualizing each year using the NRC lexicon and providing brief summaries of how each season played out and hopefully help explain why the NRC lexicon will look the way it does. Then, I’ll merge the 2010-2014 seasons and contrast them with the combined 2015-2019 seasons using NRC lexicons. This comparison aims to address my initial question—whether the reviews turned more negative after the initial years. I’ll also analyze how these sets of years differ from each other.

Loading in Library/Data

library(tidyverse)
Warning: package 'forcats' was built under R version 4.3.2
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.2     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.0
✔ ggplot2   3.4.3     ✔ tibble    3.2.1
✔ lubridate 1.9.2     ✔ tidyr     1.3.0
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(rvest)
Warning: package 'rvest' was built under R version 4.3.2

Attaching package: 'rvest'

The following object is masked from 'package:readr':

    guess_encoding
library(lubridate)
library(httr) 
library(magrittr) 
Warning: package 'magrittr' was built under R version 4.3.2

Attaching package: 'magrittr'

The following object is masked from 'package:purrr':

    set_names

The following object is masked from 'package:tidyr':

    extract
library(XML)
Warning: package 'XML' was built under R version 4.3.2
library(ggplot2)
library(dplyr)
library(rvest)
library(tidyr)
library(tidytext)
Warning: package 'tidytext' was built under R version 4.3.2
library(stopwords)
Warning: package 'stopwords' was built under R version 4.3.2
library(udpipe)
Warning: package 'udpipe' was built under R version 4.3.2
library(textdata)
Warning: package 'textdata' was built under R version 4.3.2

Attaching package: 'textdata'

The following object is masked from 'package:httr':

    cache_info

2010 Bengal Season

bengals10_url <- "https://en.wikipedia.org/wiki/2010_Cincinnati_Bengals_season"

# Read HTML content from the Wikipedia page
bengals10_page <- read_html(bengals10_url)

# Extract text from the Wikipedia page
bengals10_text <- bengals10_page %>%
  html_nodes(".mw-parser-output p") %>%
  html_text() %>%
  paste(collapse = " ")

# Tokenize the text and clean it for analysis
bengals10_tokens <- tibble(text = bengals10_text) %>%
  unnest_tokens(word, text) %>%
  anti_join(stop_words)             
Joining with `by = join_by(word)`
# Load in the NRC lexicon
nrc <- get_sentiments("nrc")

# Perform sentiment analysis using the NRC lexicon
bengals10_sentiments <- bengals10_tokens %>%
  inner_join(nrc, by = "word", relationship = "many-to-many") %>%
  group_by(sentiment) %>%
  summarize(sentiment_count = n())  # Modify this based on your analysis needs

# Visualize emotional sentiment counts
# Modify the visualization according to your preferences
ggplot(bengals10_sentiments, aes(x = sentiment, y = sentiment_count, fill = sentiment)) +
  geom_bar(stat = "identity") +
  labs(title = "Sentiment Analysis of Bengals 2010 Season",
       y = "Sentiment Count",
       x = "Emotional Sentiment") +
  theme_minimal()

This season had a lot of anticipation as the season before the Bengals went 10-6 and made it to the playoffs but lost in the wildcard round. The Bengals went out and signed a big name wide receiver in Terell Owens to pair next to Chad Johnson The season started out strong as the Bengals started 2-1 and looked promising but that did not last long as the Bengals finished with a 4-12 record and did not make the playoffs. The season was a dud so that is why we see some anger and negative in chart we also see that there is trust and this is because the Bengals have been solid in recent years and there is general trust and belief in the organization. Something to also note is that this was Carson Palmers last year as the Bengals QB as they will look to move on to a new guy for the coming years.

2011 Bengal Season

bengals11_url <- "https://en.wikipedia.org/wiki/2011_Cincinnati_Bengals_season#:~:text=After%20going%201%E2%80%933%20in,round%20to%20the%20Houston%20Texans."

# Read HTML content from the Wikipedia page
bengals11_page <- read_html(bengals11_url)

# Extract text from the Wikipedia page
bengals11_text <- bengals11_page %>%
  html_nodes(".mw-parser-output p") %>%
  html_text() %>%
  paste(collapse = " ")

# Tokenize the text and clean it for analysis
bengals11_tokens <- tibble(text = bengals11_text) %>%
  unnest_tokens(word, text) %>%
  anti_join(stop_words)             
Joining with `by = join_by(word)`
# Load in the NRC lexicon
nrc11 <- get_sentiments("nrc")

# Perform sentiment analysis using the NRC lexicon
bengals11_sentiments <- bengals11_tokens %>%
  inner_join(nrc11, by = "word", relationship = "many-to-many") %>%
  group_by(sentiment) %>%
  summarize(sentiment_count = n())  # Modify this based on your analysis needs

# Visualize emotional sentiment counts
# Modify the visualization according to your preferences
ggplot(bengals11_sentiments, aes(x = sentiment, y = sentiment_count, fill = sentiment)) +
  geom_bar(stat = "identity") +
  labs(title = "Sentiment Analysis of Bengals 2011 Season",
       y = "Sentiment Count",
       x = "Emotional Sentiment") +
  theme_minimal()

The 2011 Bengals season starts by the Bengals drafting a new rookie wide receiver with the 4th pick in the draft A.J. Green, then drafting a new rookie quarterback later in the first round Andy Dalton. The Bengals went 9-7 on the year showed improvement this was also impressive being led by a rookie quarterback who had a promising season. They barley missed the playoffs but this was a very promising season. We can see a high anticipation score as this was a completely new team. We also see a higher fear sadness and surprise score and this is because the Bengals got rid of some of their franchise guys from previous seasons such as quarterback and lost some receivers as well. Also see that positive is the highest as this season wasn’t supposed to be a very good one but we performed well and that was very positive.

2012 Bengal Season

bengals12_url <- "https://en.wikipedia.org/wiki/2012_Cincinnati_Bengals_season"

# Read HTML content from the Wikipedia page
bengals12_page <- read_html(bengals12_url)

# Extract text from the Wikipedia page
bengals12_text <- bengals12_page %>%
  html_nodes(".mw-parser-output p") %>%
  html_text() %>%
  paste(collapse = " ")

# Tokenize the text and clean it for analysis
bengals12_tokens <- tibble(text = bengals12_text) %>%
  unnest_tokens(word, text) %>%
  anti_join(stop_words)             
Joining with `by = join_by(word)`
# Load in the NRC lexicon
nrc12 <- get_sentiments("nrc")

# Perform sentiment analysis using the NRC lexicon
bengals12_sentiments <- bengals12_tokens %>%
  inner_join(nrc12, by = "word", relationship = "many-to-many") %>%
  group_by(sentiment) %>%
  summarize(sentiment_count = n())  # Modify this based on your analysis needs

# Visualize emotional sentiment counts
# Modify the visualization according to your preferences
ggplot(bengals12_sentiments, aes(x = sentiment, y = sentiment_count, fill = sentiment)) +
  geom_bar(stat = "identity") +
  labs(title = "Sentiment Analysis of Bengals 2012 Season",
       y = "Sentiment Count",
       x = "Emotional Sentiment") +
  theme_minimal()

The Bengals returned ready to go this next season as they went 10-7 making the playoffs. This was an improvement from the prior season. They ended up losing in the wildcard round to the Houston Texans. This was considered a positive season as they improve and had a lot of anticipation and even though they lost in the wildcard round there is still a high level of trust in the organization. There was not a high negative score this year either which is really good to see!

2013 Bengal Season

bengals13_url <- "https://en.wikipedia.org/wiki/2013_Cincinnati_Bengals_season"

# Read HTML content from the Wikipedia page
bengals13_page <- read_html(bengals13_url)

# Extract text from the Wikipedia page
bengals13_text <- bengals13_page %>%
  html_nodes(".mw-parser-output p") %>%
  html_text() %>%
  paste(collapse = " ")

# Tokenize the text and clean it for analysis
bengals13_tokens <- tibble(text = bengals13_text) %>%
  unnest_tokens(word, text) %>%
  anti_join(stop_words)             
Joining with `by = join_by(word)`
# Load in the NRC lexicon
nrc13 <- get_sentiments("nrc")

# Perform sentiment analysis using the NRC lexicon
bengals13_sentiments <- bengals13_tokens %>%
  inner_join(nrc13, by = "word", relationship = "many-to-many") %>%
  group_by(sentiment) %>%
  summarize(sentiment_count = n())  # Modify this based on your analysis needs

# Visualize emotional sentiment counts
# Modify the visualization according to your preferences
ggplot(bengals13_sentiments, aes(x = sentiment, y = sentiment_count, fill = sentiment)) +
  geom_bar(stat = "identity") +
  labs(title = "Sentiment Analysis of Bengals 2013 Season",
       y = "Sentiment Count",
       x = "Emotional Sentiment") +
  theme_minimal()

The season was highly anticipated and was another promising season as QB Andy Dalton looked even better throwing for 42,00 yards and 33 touchdowns. The Bengals improved this season as well went 11-5 and won the division getting a home playoff game. They faced the Chargers at home and lost 27-10. The loss marked a disappointing end to what was a very promising season. We see a higher positive score as this season tied the Bengals best record ever and also see a pretty high trust score as the organization is getting better each season. A little bit higher on the negative score this season this is mostly from the ending of the season as they were favored to win while also having home field advantage and still losing the game.

2014 Bengal Season

bengals14_url <- "https://en.wikipedia.org/wiki/2014_Cincinnati_Bengals_season"

# Read HTML content from the Wikipedia page
bengals14_page <- read_html(bengals14_url)

# Extract text from the Wikipedia page
bengals14_text <- bengals14_page %>%
  html_nodes(".mw-parser-output p") %>%
  html_text() %>%
  paste(collapse = " ")

# Tokenize the text and clean it for analysis
bengals14_tokens <- tibble(text = bengals14_text) %>%
  unnest_tokens(word, text) %>%
  anti_join(stop_words)             
Joining with `by = join_by(word)`
# Load in the NRC lexicon
nrc14 <- get_sentiments("nrc")

# Perform sentiment analysis using the NRC lexicon
bengals14_sentiments <- bengals14_tokens %>%
  inner_join(nrc14, by = "word", relationship = "many-to-many") %>%
  group_by(sentiment) %>%
  summarize(sentiment_count = n())  # Modify this based on your analysis needs

# Visualize emotional sentiment counts
# Modify the visualization according to your preferences
ggplot(bengals14_sentiments, aes(x = sentiment, y = sentiment_count, fill = sentiment)) +
  geom_bar(stat = "identity") +
  labs(title = "Sentiment Analysis of Bengals 2014 Season",
       y = "Sentiment Count",
       x = "Emotional Sentiment") +
  theme_minimal()

The Bengals had high expectations this season after having a great regular season the prior season. The Bengals went 10-5-1 this season and made the playoffs. QB Andy Dalton and WR A.J. Green are becoming a dynamic duo in the NFL while the defense is also playing at a very high level. The Bengals won the division again and got home field advantage against the Colts. The Bengals once again lost in while not scoring a single point in the second half ending yet again another promising season in a negative way. We see the anticipation score was high as this season had some high expectations and a positive score as most of the season was pretty good and the stars on team are rising.

2015 Bengal Season

bengals15_url <- "https://en.wikipedia.org/wiki/2015_Cincinnati_Bengals_season"

# Read HTML content from the Wikipedia page
bengals15_page <- read_html(bengals15_url)

# Extract text from the Wikipedia page
bengals15_text <- bengals15_page %>%
  html_nodes(".mw-parser-output p") %>%
  html_text() %>%
  paste(collapse = " ")

# Tokenize the text and clean it for analysis
bengals15_tokens <- tibble(text = bengals15_text) %>%
  unnest_tokens(word, text) %>%
  anti_join(stop_words)             
Joining with `by = join_by(word)`
# Load in the NRC lexicon
nrc15 <- get_sentiments("nrc")

# Perform sentiment analysis using the NRC lexicon
bengals15_sentiments <- bengals15_tokens %>%
  inner_join(nrc15, by = "word", relationship = "many-to-many") %>%
  group_by(sentiment) %>%
  summarize(sentiment_count = n())  # Modify this based on your analysis needs

# Visualize emotional sentiment counts
# Modify the visualization according to your preferences
ggplot(bengals15_sentiments, aes(x = sentiment, y = sentiment_count, fill = sentiment)) +
  geom_bar(stat = "identity") +
  labs(title = "Sentiment Analysis of Bengals 2015 Season",
       y = "Sentiment Count",
       x = "Emotional Sentiment") +
  theme_minimal()

The seasonn was once again highly anticipated from the success from the prior season. The Bengals started our red hot starting the season 7-0. QB Andy Dalton was having a MVP caliber season thus far into the season. As the season went on the Bengals had some key injuries on big one was Andy Dalton getting injured. Even with these injuries the Bengals finished the season 12-4 winning the division securing home field advantage in the playoffs again. They faced the Steelers in the wildcard round and once again lost the wildcard game to a rival team. This was the Bengals have not won a playoff game since 1990 and people are starting t scratch their heads on why the Bengals can’t win in the playoffs. Overall this was a successful regular season finishing 12-4 and still won after losing some key guys. There is higher sadness and negative score and this is because they lost again in the first round of the playoffs.

2016 Bengal Season

bengals16_url <- "https://en.wikipedia.org/wiki/2016_Cincinnati_Bengals_season"

# Read HTML content from the Wikipedia page
bengals16_page <- read_html(bengals16_url)

# Extract text from the Wikipedia page
bengals16_text <- bengals16_page %>%
  html_nodes(".mw-parser-output p") %>%
  html_text() %>%
  paste(collapse = " ")

# Tokenize the text and clean it for analysis
bengals16_tokens <- tibble(text = bengals16_text) %>%
  unnest_tokens(word, text) %>%
  anti_join(stop_words)             
Joining with `by = join_by(word)`
# Load in the NRC lexicon
nrc16 <- get_sentiments("nrc")

# Perform sentiment analysis using the NRC lexicon
bengals16_sentiments <- bengals16_tokens %>%
  inner_join(nrc16, by = "word", relationship = "many-to-many") %>%
  group_by(sentiment) %>%
  summarize(sentiment_count = n())  # Modify this based on your analysis needs

# Visualize emotional sentiment counts
# Modify the visualization according to your preferences
ggplot(bengals16_sentiments, aes(x = sentiment, y = sentiment_count, fill = sentiment)) +
  geom_bar(stat = "identity") +
  labs(title = "Sentiment Analysis of Bengals 2016 Season",
       y = "Sentiment Count",
       x = "Emotional Sentiment") +
  theme_minimal()

The Bengals had once again a lot of anticipation coming into the season as they had a great last season. The Bengals went 6-9-1 and missed the playoffs. The Bengals played in many close games they just did not win them. This is the first time the Bengals missed the playoffs as the past five seasons they made it. Overall the lexicon score is still positive as this may was hopefully just a down year for the Bengals but people still trust the organization.

2017 Bengal Season

bengals17_url <- "https://en.wikipedia.org/wiki/2017_Cincinnati_Bengals_season"

# Read HTML content from the Wikipedia page
bengals17_page <- read_html(bengals17_url)

# Extract text from the Wikipedia page
bengals17_text <- bengals17_page %>%
  html_nodes(".mw-parser-output p") %>%
  html_text() %>%
  paste(collapse = " ")

# Tokenize the text and clean it for analysis
bengals17_tokens <- tibble(text = bengals17_text) %>%
  unnest_tokens(word, text) %>%
  anti_join(stop_words)             
Joining with `by = join_by(word)`
# Load in the NRC lexicon
nrc17 <- get_sentiments("nrc")

# Perform sentiment analysis using the NRC lexicon
bengals17_sentiments <- bengals17_tokens %>%
  inner_join(nrc17, by = "word", relationship = "many-to-many") %>%
  group_by(sentiment) %>%
  summarize(sentiment_count = n())  # Modify this based on your analysis needs

# Visualize emotional sentiment counts
# Modify the visualization according to your preferences
ggplot(bengals17_sentiments, aes(x = sentiment, y = sentiment_count, fill = sentiment)) +
  geom_bar(stat = "identity") +
  labs(title = "Sentiment Analysis of Bengals 2017 Season",
       y = "Sentiment Count",
       x = "Emotional Sentiment") +
  theme_minimal()

The Bengals start the season slow but then showed resilience and finished the season 7-9. They showed some moments of greatness. Offensively QB Andy Dalton was inconsistent but showed flashes of greatness same thing on the defensive end is they struggled to find their identity during the season and were not able to be consistent. This resulted in them missing the playoffs again. This season had a higher joy factor and this is because the team showed life again during the season and finished the season on a high note. The flashes of greatness during the season really reflected how positive the review of this season is.

2018 Bengal Season

bengals18_url <- "https://en.wikipedia.org/wiki/2018_Cincinnati_Bengals_season"

# Read HTML content from the Wikipedia page
bengals18_page <- read_html(bengals18_url)

# Extract text from the Wikipedia page
bengals18_text <- bengals18_page %>%
  html_nodes(".mw-parser-output p") %>%
  html_text() %>%
  paste(collapse = " ")

# Tokenize the text and clean it for analysis
bengals18_tokens <- tibble(text = bengals18_text) %>%
  unnest_tokens(word, text) %>%
  anti_join(stop_words)             
Joining with `by = join_by(word)`
# Load in the NRC lexicon
nrc18 <- get_sentiments("nrc")

# Perform sentiment analysis using the NRC lexicon
bengals18_sentiments <- bengals18_tokens %>%
  inner_join(nrc18, by = "word", relationship = "many-to-many") %>%
  group_by(sentiment) %>%
  summarize(sentiment_count = n())  # Modify this based on your analysis needs

# Visualize emotional sentiment counts
# Modify the visualization according to your preferences
ggplot(bengals18_sentiments, aes(x = sentiment, y = sentiment_count, fill = sentiment)) +
  geom_bar(stat = "identity") +
  labs(title = "Sentiment Analysis of Bengals 2018 Season",
       y = "Sentiment Count",
       x = "Emotional Sentiment") +
  theme_minimal()

The Bengals started out the season hot starting out with 4-1 record but as the season went on they struggled to finish games and lost some key guys to injuries. Towards the end of the season the Bengals fired long time head coach Marvin Lewis. The Bengals finished a disappointing season finishing 6-10. This season had higher scores in fear, joy, surprise, and sadness than normal and this is because of the promising start then falling apart then even firing the head coach mid season which evokes a lot of emotions which we can see in this season.

2019 Bengal Season

bengals19_url <- "https://en.wikipedia.org/wiki/2019_Cincinnati_Bengals_season"

# Read HTML content from the Wikipedia page
bengals19_page <- read_html(bengals19_url)

# Extract text from the Wikipedia page
bengals19_text <- bengals19_page %>%
  html_nodes(".mw-parser-output p") %>%
  html_text() %>%
  paste(collapse = " ")

# Tokenize the text and clean it for analysis
bengals19_tokens <- tibble(text = bengals19_text) %>%
  unnest_tokens(word, text) %>%
  anti_join(stop_words)             
Joining with `by = join_by(word)`
# Load in the NRC lexicon
nrc19 <- get_sentiments("nrc")

# Perform sentiment analysis using the NRC lexicon
bengals19_sentiments <- bengals19_tokens %>%
  inner_join(nrc19, by = "word", relationship = "many-to-many") %>%
  group_by(sentiment) %>%
  summarize(sentiment_count = n())  # Modify this based on your analysis needs

# Visualize emotional sentiment counts
# Modify the visualization according to your preferences
ggplot(bengals19_sentiments, aes(x = sentiment, y = sentiment_count, fill = sentiment)) +
  geom_bar(stat = "identity") +
  labs(title = "Sentiment Analysis of Bengals 2019 Season",
       y = "Sentiment Count",
       x = "Emotional Sentiment") +
  theme_minimal()

The Bengals hire new head coach Zac Taylor and finish the worst season in franchise history with a record of 2-14. This gave them the first pick which everyone knew who they were picking with star QB Joe Burrow coming out of college which some say he had the greatest college football season ever. This season got a high positive score because of this alone as this would give the struggling franchise hope again. The fear comes from not really knowing what to expect with the new head coach. There is also more sadness and negative this season and this is because this was the worst season in franchise history.

Contrasting Eras

I will be looking at the 2010-2014 seasons NRC scores and compare it to the 2015-2019 NRC scores.

frontbengals <- bind_rows(bengals10_sentiments, bengals11_sentiments, bengals12_sentiments, bengals13_sentiments, bengals14_sentiments) %>%
  group_by(sentiment) %>%
  summarize(sentiment_count = sum(sentiment_count))

# Combine sentiment analysis for 2015-2019
backbengals <- bind_rows(bengals15_sentiments, bengals16_sentiments, bengals17_sentiments, bengals18_sentiments, bengals19_sentiments) %>%
  group_by(sentiment) %>%
  summarize(sentiment_count = sum(sentiment_count))

# Add group labels to differentiate between 2010-2014 and 2015-2019
frontbengals$group <- "2010-2014"
backbengals$group <- "2015-2019"

# Combine the data for plotting
combined_sentiments <- rbind(frontbengals, backbengals)

# Plotting side-by-side bar charts for sentiment analysis
ggplot(combined_sentiments, aes(x = sentiment, y = sentiment_count, fill = group)) +
  geom_bar(stat = "identity", position = "dodge") +
  labs(title = "Sentiment Analysis Comparison: 2010-2014 vs 2015-2019 Bengals Seasons",
       y = "Sentiment Count",
       x = "Emotional Sentiment",
       fill = "Season Group") +
  theme_minimal()

The comparison in sentiment combined scores between the 2010-2014 and 2015-2019 periods surprised me. There’s a stark contrast with significantly higher emotional expressions evident in the 15-19 seasons across all categories. It’s beginning to make more sense to me now, especially considering the emotional ride those seasons offered. The 2015 season, in particular, stood out as the franchise’s best, likely contributing significantly to the heightened emotions observed. Moreover, the multitude of highs and lows during this latter period explains the overall increase in emotional scores compared to the 10-14 era. The earlier years seemed more consistently positive, marked by regular season successes, despite falling short in the playoffs.