Sentiment by Naive Bayes
Based off this lesson to determine the sentiment of a text.
We use the same process to detect the likeness of what you are writing relative to the books Tolstoy(his biography) or Hamlet.
We get the count of each word in the books, find the prior for the books (what percentage of the texts comes from each book), and the total word count for each book. This is saved in a JSON that get's loaded to this page.
We then take the text you write, find the probability for each book, and give a score based on the difference between the two probabilities.
Word sequence is not considered, it's just a bag of words.