Skip to content
/ gnovel Public

For Automatic Generation of Character Maps Using NLP

License

Notifications You must be signed in to change notification settings

frongk/gnovel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gnovel

For Automatic Generation of Character Maps Using NLP

Description and Example Output

This package (in progress) can be used to analyze a .mobi ebook and determine the relationships between characters. Below is a sample graph generated from analysis of Harry Potter and the Philosopher's Stone by J.K. Rowling. Harry Potter 1

Method

There are two inputs that are used the script. These are the ebook in .mobi format and a text list of the characters that you want to analyze where each character is separated by a newline character. These scripts will read through the ebook file and find instances in which different characters interact. This is tabulated as probabilities of characters co-appearing. After probabilities are generated, a graph depicting significant relationships is rendered.

Usage and Setup

from gnovel.main import Gnovel

novel_graph = Gnovel('book.mobi', 'character_list.txt')
novel_graph.draw_graph('output.file')

Dependencies

Make sure that your python environment has the following dependencies installed:

BeautifulSoup
nltk
tqdm 
numpy 
pandas
matplotlib
networkx

Additional Features (Planned)

  1. Character recognition using named-entity recognition (NER)
  2. Relationship positivity (Sentiment Analysis)

About

For Automatic Generation of Character Maps Using NLP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages