Writer’s Log: 1790 Sentiment Cycle

Ready for maths? No? Well, how about pictures?

TGE_SentimentCycle

Nice, Mole, what are we looking at?

What you see before you is a word sentiment chart of The Gribble’s Eye plotted over the length of the story. This was created using some “R” code and the libraries offered by the professor behind http://www.archerjockers.com/

The pair of people behind the book The Bestseller Code used such code to allow them to grade and understand the so-called literary market: https://books.google.com/books/about/The_Bestseller_Code.html?id=4fXUDAAAQBAJ&printsec=frontcover&source=kp_read_button#v=onepage&q&f=false

I took their code and ran my second, wee novel through it. And that picture is what the code produced.

Sentiment goes up and down. Happy and gay and positive. Sad, angry, loathsome and negative. Good books have a signature sine wave of sentiment. Marketable books have this even more.

Now, mine is neither good nor marketable, but, it’s interesting to note that there is a definite pattern to the story: We start up, then down, up, down, and end on a big UP!

Whee! What a ride.

You want to do this for your own story? Sure. Here’s the R code:

library(syuzhet)
library(readtext)
setwd("C:\\Documents and Settings\\MeTheUser\\Desktop\\")
text <- get_text_as_string("YOURBOOK.txt")
s_v <- get_sentences(text)
raw_values <- get_sentiment(s_v, method = "syuzhet")
dct_vals <- get_dct_transform(raw_values)
simple_plot(raw_values, title = "TITLE OF BOOK", legend_pos = "top", lps = 20, window = 0.05)

You’ll have to struggle with installing the supporting modules — but, hey! You’re smart. You can figure it out.

(If you can’t, send me your story text — just words — and I’ll run them through this bit of code for you.)


6 thoughts on “Writer’s Log: 1790 Sentiment Cycle

    1. Glad you thought it intriguing. Yeah, I think this analysis stuff has some ex post relation to how to market or work with a particular novel. Well, that’s the analyst in me talking.

      Liked by 1 person

        1. Absolutely. Although the resolution will dwindle with fewer words. You write “happy day today, sad day tomorrow” and you won’t get much responsiveness. If you a sample (even a gutenberg sample) you want run, let me know.

          Liked by 1 person

            1. You seem to be of an equitably positioned persona situated as such to adsorb and propose — equally — notions that might benefit us both. How might you consider leveraging such a symbiotic vision of the world?

              Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s