This was my entry for NaNoGenMo 2022. It takes the original text of Charles Dickens' A Tale of Two Cities and analyses each paragraph for positive and negative sentiment, dividing up the text into two smaller books - the first containing all net-positive paragraphs, and the second containing all the negatives.
The script uses the VADER sentiment lexicon. (Hutto, C.J. & Gilbert, E.E. (2014). VADER: A Parsimonious Rule-based Model for Sentiment Analysis of Social Media Text. Eighth International Conference on Weblogs and Social Media (ICWSM-14). Ann Arbor, MI, June 2014.)
Full output: https://kevan.org/nanogenmo/2022/cities.html