Comparing Word Usage in Shakespeare’s the Rape of Lucrece and Venus and Adonis

Sentiment Analysis

The results from our comparison of word usage in Venus and Adonis and the Rape of Lucrece seem to indicate a distinct difference in tone between the two poems. But let’s take this comparison up a notch and quantify the sentiment of the poems by stanza.

Sentiment in the Rape of Lucrece

Sentiment in the Rape of Lucrece

Sentiment in Venus and Adonis

Each poem has its own fluctuations in sentiment. The Rape of Lucrece plummets when the actual sexual violence occurs but raises again. This raise is due to the shift in perspective from the victim (Lucrece) to the perpetrator (Tarquinius). Similarly, sentiment in Venus and Adonis shifts based on perspective. Stanzas where Venus is the main character have a more positive sentiment score until the very end, while stanzas where Adonis’ point-of-view is emphasized appear to have an overall negative sentiment score. This character based polarity(ie Venus=positive, Adonis=negative) is common in both texts, showing that Shakespeare may have had a penchant for these types of dichotomies.

These charts are good for tracking the progression of sentiment throughout the poems but the differences between the two become even more pronounced when aggregate sentiment scores are counted. With this metric we see that the Rape of Lucrece with an aggregate score of -87 is significantly more negative then Venus and Adonis with a score of -9. Based on this evidence it is safe to conclude that Shakespeare honored his promise to produce, “some graver labour.”

Sentiment Analysis Code

#import the text with readLines. This will allow you to retain the spaces the separate the stanzas
lucrece.lines<-readLines(“c:\\Users\\your.location\\TheRapeofLucrece.txt”, n = -1L, ok = TRUE, warn = TRUE,encoding = “unknown”, skipNul = FALSE)
LDATA.df<-data.frame(lucrece.lines)
Lucrece<-LDATA.df[c(364:2483),]#cut out all of the projectGutenberg information
L.df<-data.frame(Lucrece)
stanza.spaces<-(grep(“^\\s*$”, Lucrece))#use space between the stanzas to break text into stanzas
start.lines end.lines<-stanza.spaces
Lucrece.stanzas.df for (i in 1:length(Lucrece.stanzas.df$end)){Lucrece.stanzas.df$text[i] <-paste(Lucrece[Lucrece.stanzas.df$start[i]:Lucrece.stanzas.df$end[i]],collapse = ” “)}
colnames(Lucrece.stanzas.df)[3] <- “Stanzas”
#activate ggplot2 and sentimentr packages
Lucrece.stanzas<-sentiment_by(Lucrece.stanzas.df$Stanzas, by=NULL)
Lucrece.sentiment.df<-data.frame(Lucrece.stanzas)
colnames(Lucrece.sentiment.df)[4]<- “Sentiment”
colnames(Lucrece.sentiment.df)[1]<-“Stanza”
ggplot(Lucrece.sentiment.df, aes(x=Stanza, y=Sentiment)) +geom_line() +geom_point()
#repeat process with Venus and Adonis but substitute -7 for -6

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *