Analyzing Plot Structure of Novels Using Sentiment Analysis

March 23, 2018 | By Zakir Hossain | Filed in: Technical Blog.

Most college education about writing is based on sentences. A few years ago, I took some literary writing workshops. The teachers and students were always talking about beautiful sentences. On the other hand, if you follow podcasts or blogs of genre writers, the emphasis is more on the novel plot structure.

Most college classes seem to concentrate on better sentence structure because it is teachable in a classroom environment. You can analyze a sentence to the last dot or comma. It’s difficult to analyze a plot. Even trying to figure out your own book takes a long time. Imagine trying to analyze 10 student novels in a classroom.

I wanted to visualize the plot structure of famous novels. The idea is from Story Grid. But it seems like a mind-numbing task to come up with the graph of even a single novel. My background is in software automation. So I wondered if there was a way to use computer programs. Recently, I was looking at some data analysis packages and the sentiment analysis tool seemed like a good solution for the problem.

I used the TextBlob sentiment analyzer to evaluate the emotions of novels. The sentiment goes from 1 (positive emotion) to -1 (negative emotion).

Here are some simple tests I ran to see how it works:

>>> TextBlob(“It’s a beautiful day.”).sentiment.polarity
0.85
>>> TextBlob(“It’s a dark day.”).sentiment.polarity
-0.15
>>> TextBlob(“He had a bad accident.”).sentiment.polarity
-0.6999999999999998

People are using TextBlob to measure sentiments of social media comments on Twitter, Instagram, and Facebook. So I assume it has some value.

My objective was to use this tool to find emotions of chapters and graph the points. Analysis by scene would have been better. But I divide the text manually. So dividing up into scenes is too much work.

Here are some results:

Game of Thrones

Harry Potter

Neuromancer

Frankenstein

Great Expectations

Pride and Prejudice

Some quick observations:

  • Most novels spend the bulk of their time in the positive emotional territory, even dark novels. I was surprised that Frankenstein never goes negative. I thought maybe it’s because it’s an older book. But Great Expectations goes to negative territory quite a few times.
  • I haven’t read Neuromancer yet, but it seems like one of the most depressing plot lines in this group. Most books fluctuate and typically end on a positive note. Neuromancer keeps going downward.

How Can Plot Analysis Be Useful

Even though a development editor is a much better option, this kind of analysis can give you rough ideas about a novel’s emotional movement and plot structure. You can make simple observations about your novel. For example, lack of emotional variation (boring), too much negativity in a romance novel (disappoint romance reader expectations), etc.

I haven’t verified if the emotional indexes actually correlate to the content of the chapters. But it’s fun when the graph shows up first time on your screen. In the future, I’ll probably try to plot a novel just after I finished reading it. If the material is fresh in my mind, I can judge the accuracy of the graphs better.


Tags: ,

Comments are closed here.