Objective:

I was curious what a sermon would look like doing text analysis with the Syuzhet Package (https://cran.r-project.org/web/packages/syuzhet/vignettes/syuzhet-vignette.html). I chose Pastor Tim Knight’s Easter message. I obatined the mp4 off of the Church website and converted it to text using an application (I didn’t know that could be done). I then uploaded the text into R and began the analysis which can be seen below.

Uploading the data. There are time stamps in the data. I am choosing to leave them in for now as some of the functions I will use will clear them up.

df <- read_csv("easter.2018.txt")
## Parsed with column specification:
## cols(
##   Easter2018.mp3 = col_character()
## )

Some quick summary Data. Easter as we would expect is mentioned the most and secondarily Jesus number 2. Looks good.

tidy <- df%>%
  unnest_tokens(word, Easter2018.mp3)%>%
  anti_join(stop_words)%>%
  count(word, sort=T)
## Joining, by = "word"
tidy$word <- toupper(tidy$word)
tidy2 <- tidy[-1,]
datatable(tidy2)

Now I want to check out the Sentiment Package so let’s get after it and see what it’s all about.

Fist thing I need to do is split the text into sentences. After doing that I notice that there are some time stamps in the data. Shouldn’t make any difference though I may go back and grab them out later.

There are a total of 348 sentences in the Sermon.

data <- get_sentences(df$Easter2018.mp3)
str(data)
##  chr [1:348] "[00:00:01] At line it's our tradition when we read a portion of Scripture to ask you to stand in honor of God's word." ...
head(data,4)
## [1] "[00:00:01] At line it's our tradition when we read a portion of Scripture to ask you to stand in honor of God's word."
## [2] "So would you do that please."                                                                                         
## [3] "I just want to say right at the top."                                                                                 
## [4] "We've got a very crowded platform today and I can't get to you all."

Now I’m going to create the sentiment vector using Stanford’s Sentiment Lexicon and then I’m going to look at its score (pos/neg) and note it as a positive score means the message is uplifting and a negative likely not so uplifting. After I will plot the data over time.

The score is 109.5. So it’s not going to be a terribly negative sermon. I’m curious to see how this score relates to other Easter Sermons. Future analysis perhaps?

Time to graph.

sent <- get_sentiment(data)
sum(sent)
## [1] 109.5

It appears looking at the graph that the sermon starts strong and then rocks back and forth the remainder of the time never returning to the higher sentiments seen at the beginning.

sent <- get_sentiment(data)

plot(sent, type = "l", col = "blue",   main="Plot Trajectory for Easter Sermon", 
  xlab = "Narrative Time", 
  ylab= "Emotional Valence")

Let’s break into 10 (3) minute sections and see what that shows. And then plot it.

Looks pretty good. I haven’t listened to the sermon but I can see its basic emotional structure.

data_binned <- get_percentage_values(sent, 10)

plot(data_binned, type = "l", col = "blue",   main="Plot Trajectory for Easter Sermon", 
  xlab = "Narrative Time", 
  ylab= "Emotional Valence")

I am curious about the ending and why it went down so much. I’ll look at last 75 lines. Yep. Pastor talks is illustrating through examples (not all positive) about our victory in Christ. So yea the drop off makes sense.

data[300:349]
##  [1] "The sports announcer says the game is unwinnable."                                                                                                                                                                                                                                                                                                                                                                   
##  [2] "The foreman says the quota is unobtainable."                                                                                                                                                                                                                                                                                                                                                                         
##  [3] "The insurance adjuster says the car is unrepairable."                                                                                                                                                                                                                                                                                                                                                                
##  [4] "The judge says the marriage is irreconcilable."                                                                                                                                                                                                                                                                                                                                                                      
##  [5] "[00:22:44] But then comes Jesus and the news changes from settled bad news to forever good news because Jesus says the resurrection is unstoppable."                                                                                                                                                                                                                                                                 
##  [6] "[00:22:55] Amen."                                                                                                                                                                                                                                                                                                                                                                                                    
##  [7] "And the implications of that filter into our lives every day."                                                                                                                                                                                                                                                                                                                                                       
##  [8] "[00:23:01] Easter says yes our faith is true."                                                                                                                                                                                                                                                                                                                                                                       
##  [9] "Yes our forever is beautiful."                                                                                                                                                                                                                                                                                                                                                                                       
## [10] "And yes your life is good."                                                                                                                                                                                                                                                                                                                                                                                          
## [11] "Yes."                                                                                                                                                                                                                                                                                                                                                                                                                
## [12] "Wow."                                                                                                                                                                                                                                                                                                                                                                                                                
## [13] "[00:23:11] Thank you Jesus."                                                                                                                                                                                                                                                                                                                                                                                         
## [14] "As we come to the communion table today I don't know if you've ever taken the time to read first Corinthians 15."                                                                                                                                                                                                                                                                                                    
## [15] "[00:23:19] It's a it's a chapter and it goes through all of the the joys if the resurrection is true and all the problems if it's not true all of the dire consequences if Jesus did not raise and at the very last verse of this long chapter 58 verses and the very last verse after making the case for Easter Paul did not say OK church now fight about that OK church just forget about that and file it away."
## [16] "Don't worry about it."                                                                                                                                                                                                                                                                                                                                                                                               
## [17] "Now after Paul made the case for Easter this is what he said."                                                                                                                                                                                                                                                                                                                                                       
## [18] "Therefore my beloved brothers and sisters be steadfast immovable always abounding in the work of the Lord."                                                                                                                                                                                                                                                                                                          
## [19] "[00:24:02] Knowing that the Lord your labour is not in vain."                                                                                                                                                                                                                                                                                                                                                        
## [20] "What does that mean."                                                                                                                                                                                                                                                                                                                                                                                                
## [21] "It means the implications of Easter filter out into our lives every day."                                                                                                                                                                                                                                                                                                                                            
## [22] "[00:24:11] It matters what you do with your life because the tomb is empty during World War II."                                                                                                                                                                                                                                                                                                                     
## [23] "There were a group of soldiers that were being held as prisoners of war and among the captured was a chaplain named Macdonald."                                                                                                                                                                                                                                                                                      
## [24] "[00:24:26] But they called him Padre Mac and another prisoner had possessed a secret crystal radio that he used to listen to the BBC and one day as he listened to that secret radio he heard an announcement that the day had come and the man turned to Padre Mack and simply said three words."                                                                                                                   
## [25] "They have come."                                                                                                                                                                                                                                                                                                                                                                                                     
## [26] "Padre Mac knew exactly what that meant and spread the word throughout the camp."                                                                                                                                                                                                                                                                                                                                     
## [27] "And it changed everything."                                                                                                                                                                                                                                                                                                                                                                                          
## [28] "The man in the camp were electrified."                                                                                                                                                                                                                                                                                                                                                                               
## [29] "They were laughing and slapping each other on the back."                                                                                                                                                                                                                                                                                                                                                             
## [30] "And they were celebrating."                                                                                                                                                                                                                                                                                                                                                                                          
## [31] "Everything changed."                                                                                                                                                                                                                                                                                                                                                                                                 
## [32] "Why."                                                                                                                                                                                                                                                                                                                                                                                                                
## [33] "Because they believe those three words they have come understand something."                                                                                                                                                                                                                                                                                                                                         
## [34] "They're still in a prisoner of war camp."                                                                                                                                                                                                                                                                                                                                                                            
## [35] "There are still guards with machine guns."                                                                                                                                                                                                                                                                                                                                                                           
## [36] "There's still a fence with barbed wire and searchlights and they could have ignored the message from the BBC and continue to be hopeless and dejected but instead they chose to believe the words they have come and it changed everything."                                                                                                                                                                         
## [37] "The same is true for us today on Easter."                                                                                                                                                                                                                                                                                                                                                                            
## [38] "You can choose to believe the words he is risen say it with me."                                                                                                                                                                                                                                                                                                                                                     
## [39] "He is risen."                                                                                                                                                                                                                                                                                                                                                                                                        
## [40] "And if you believe that no matter what's going on in your own prison camp no matter how many guards have machine guns aimed at you and searchlights on you and fences around you you can live a different life."                                                                                                                                                                                                     
## [41] "Because you know it's true that he is risen the cross happened paying the price."                                                                                                                                                                                                                                                                                                                                    
## [42] "That's what we celebrate at this table."                                                                                                                                                                                                                                                                                                                                                                             
## [43] "The resurrection happened conquering death."                                                                                                                                                                                                                                                                                                                                                                         
## [44] "And so now Paul would say to us well Highline."                                                                                                                                                                                                                                                                                                                                                                      
## [45] "Our beloved brothers and sisters be steadfast"                                                                                                                                                                                                                                                                                                                                                                       
## [46] "[00:26:14] Movable always abounding in the work of the Lord."                                                                                                                                                                                                                                                                                                                                                        
## [47] "[00:26:17] Knowing that in the Lord your labours never in vain he has risen."                                                                                                                                                                                                                                                                                                                                        
## [48] "I believe"                                                                                                                                                                                                                                                                                                                                                                                                           
## [49] "[00:26:24] You."                                                                                                                                                                                                                                                                                                                                                                                                     
## [50] NA

Conclusion

This was amazing. I was surprised at the simplicty of the package. It’s sentiment analysis looks spot on. When I split the sermon into 10 equal parts that really took the noise out of the graph as well. I am curious to see how other sermons compare to the 109 score this received. It’s all interesting and good practice.