This webapp is created to tell you what characters decide for the plot, who is the dominant one, and how they interact with each other. From November 2022, the website - Link - can only be run locally since the host shut down its free servers and this app is too big for other free servers.
How to use: clone the project, install Flask, and enter flask run
in your terminal.
We'll go through every step to give you an idea of what this app does.
First, you enter the book details (name and the way chapters are in the text). With the help of this info, the website scrapes more info from GoodReads website to tell you about the author, year of publishing, and other facts. The SpaCy small model is also utilized in this step to count the number of sentences in the file you upload.
We separate sentences with SpaCy and analyze them with Afinn. At the end we get a nice graph of the overall mood of the book.
After saving the sentiment indicator for each sentence, we once again process them and look for names of people\characters in the book.
Sometimes, you might not see the names of specific characters or just find some redundant names between them. If there was any change you wanted to make in the list, you can simply use the last two boxes to write the names of people in.
For this part, we analyze at how characters interact with each other by looking at their mutual occurrence in one sentence. Then, we use the sentiment scores of these sentences and create a table indicating characters relationships.
Because we want to get a good overview of characters' roles and importance, we also look at their presence through out the book. We do that by segmenting text into n pieces and counting the appearance of each person in that segment.
The final step is creating a graph. For this visualization, I utilized D3 library Graph force to depict nodes and edges.
How to contribute?
If you're interested, you can either add features to this project or fork it to create your own. The license of this project is MIT license.
Resources:
- Observable graph force
- Inspired by Ken Huang's character network project.
- EPUB to txt convertor: link