Social network from movie script — Part 2

This time we’ll create the social network for a trilogy, using the movie scripts of The Lord Of The Rings. We’ll create the network for each of the movies and then proceed to merge those networks and get one to rule them all…

In this case the scripts are in HTML, that’s why we use an HTML Parser to retrieve the information needed. The definition/identification of characters and interactions is the same as in the previous part. All the social networks have the node size relative to the degree of that node. The edge width represents the weight of that edge and the color of a node indicates its community, which is calculated with a community detection algorithm.

Disclaimer: I might not go into a lot of detail, that’s only because there is a bunch of information and I’m trying my best to keep this short.

LOTR I: The Fellowship of the Ring

Let’s start with the movie from 2001, the social network looks like:

Social network for The Lord Of The Rings I.

We were able to identify 27 characters, and two of them were discarded for the social network given that we couldn’t identify an interaction for them. Those characters were Celeborn and Hobbit Bounder.

The count of lines per character in the movie is:

And the count of scenes per character is:

It’s interesting to see how Frodo and Gandalf have the most amount of lines and scenes, followed by Sam and Aragorn.

LOTR II: The Two Towers

The social network for the film of 2002 is:

Social network for The Lord Of The Rings II.

We were able to identify 56 characters, and one of them was discarded for the social network given that we couldn’t identify an interaction for them. That character was Galadriel.

The count of lines per character in the movie is:

And the count of scenes per character is:

I wouldn’t have guessed that Gimli was in more scenes than Frodo!

LOTR III: The Return of the King

The social network for the 2003 movie is:

Social network for The Lord Of The Rings III.

We were able to identify 43 characters, and three of them were discarded for the social network given that we couldn’t identify an interaction for them. Those characters were Orcs, Guard and Elf Escort.

The count of lines per character in the movie is:

And the count of scenes per character is:

Much like in the first movie, the character with most lines and scenes are Gandalf and the hobbitses.

The ONE Social Network

Now we are going to merge these social networks to see how Middle Earth looks like, according to the movie scripts.

The merging process will take nodes with the same label (same character name) and add the weights if they have the same edges. We didn’t take into account nodes with a low degree, and that’s why you won’t find all the characters here.

A social network to rule them all.

After merging the networks, there are a couple things to mention. It’s interesting to see how our four hobbit friends end in different communities (although it makes sense, since they got separated at the end of the first movie). The strongest interaction is between Frodo and Sam though again, nothing surprising. One new thing, at least for me, is how “important” Theoden is in the network, but, if you think about it, he is the King of Rohan. That has to count…

The count of lines per character on the three movies is:

And the count of scenes per character on the three movies is:

Looking at the three movies as a whole, the characters with most lines and scenes are Gandalf, Frodo, Aragorn and Sam. This is similar to the first movie.

Metrics

If you are still with me, for this network I want to throw in here some of the main centrality metrics.

Degree Centrality: the number of other characters that you interact with.

PageRank Centrality: weighted degree centrality with a feedback boost for interacting with other important characters. The importance of your neighbors is split among its neighbors.

Closeness Centrality: the average distance to all other characters.

Betweenness Centrality: how often you lie on shortest paths between two other characters.