Mapping character interactions using nlp (and d3.ds)

Presented my Natural Language Processing (NLP) Project for the Metis folks Friday (presentation link).

For this one I wanted to try something quite a bit different than the previous couple of projects, so I decided to dive into the wilds of unsupervised learning, Word2vec, and d3.js visualization.

My basic premise is this:

Build out process to map out the interactions/relationships between main characters in a novel, both over time and by total weight, and visualize these interactions effectively (which gave an excuse to learn a little d3.js). The pipeline should be largely automated.

Here is a link the resulting pipeline on github: InteractionMaps

I spent most of the time working with the Game of Thrones series, but then pushed Lord of the Rings and the writing of the ancient greek Herodotus through it once completed. The pipeline takes less than an hour, the majority of which is messing with the d3 visualizations, not NLP. (exception: some books have characters going by a lot of different names (Game of Thrones has a TON of these!) making and correcting for these associations could add a couple of extra hours to the pipeline)

I think the presentation went over a lot better than my last couple, tried to focus more on what I had delivered, why you’d want it, and especially less on how it was made (which, as a teacher, it is a bit painful not sharing much of the process that went into making something!).

  • note: the colors on the interaction webs are set by one of the clustering algoriths and are not random. See presentation for more information.

Game of Thrones (A Song of Ice and Fire, all 5 books):   Interaction Web   &    Narrative Map . (also, here is an unfinished d3 confusion matrix, but at the moment there is still a problem with the interactions –> color density mapping)

Lord of the Rings (original trilogy):   Interaction Web   & Narrative Map

The Histories of Herodotus Herodotus: 440 B.C.E. (English Translation) : [Interaction Web](https://bl.ocks.org/Lichtphyz/1810b3f2fe6bf09a6896c8610a3983da/265858417daee9380dd426c3fce34d4a3c936ac5

Game of Thrones Narrative Chart (all 5 books)

Lord of the Rings Interaction Web (all 3 books)

The Histories of Herodotus Herodotus: 440 B.C.E.

Written on August 27, 2017