NaNoGenMo / 2018

National Novel Generation Month, 2018 edition.
https://nanogenmo.github.io/
112 stars 6 forks source link

Textillating (output: Extremely Great Expectations) #96

Open robincamille opened 5 years ago

robincamille commented 5 years ago

Ever wished the novel you were reading was way more exciting? Try Textillating it!

The user inputs a .txt file (like a novel), and my script outputs a modified version of the file wherein most adjectives have been replaced by their most extreme synonyms. In other words, the affect has been amped up.

This project uses the VADER sentiment analysis tools and WordNet from NLTK (Natural Language Tool Kit). The SentimentIntensityAnalyzer quantifies how affective a word is. Then the script checks for any synonyms from WordNet that have more extreme scores. So large might be replaced by great, and terrible might be replaced by abhorrent. If there are no viable synonyms, an intensifying adverb is added to modify the adjective.

I chose a book I never finished, Great Expectations, as my example. Is the output readable? Kind of! Does it have more extreme language and way more exclamation points? Definitely!!!!!!!!!

See my repo for the code and longer explanation with examples.

View the output for Great Expectations.


(Caveat for literary types who are offended that some might consider Dickens and the like boring: I'm a librarian who's made peace with her own reading preferences and feels very relieved not to have to read all 1000 classic novels in the Western canon. Unless they've been Textillated, of course.)

hugovk commented 5 years ago

I like all the extra exclamation marks!!!!!

There is already lodged in my hands a sum of money amply EMPHATICALLY SUFFICIENT for your WORTHY education and maintenance! You will please consider me your DEFENDER! Oh!!!!!!!!!!!!!

image