Code Monkey home page Code Monkey logo

starwars-social-network's Introduction

The Star Wars social network

This repository contains the code I used to create my blog post on the Star Wars social network.

Update: I added the 7th episode Star Wars: The Force Awakens and included more network analysis on my blog.

The folder data contains:

  • characters.csv: extracted list of named characters that appeared in the screenplays.

  • aliases.csv: csv file with alternative names for some of the characters

  • charactersPerScene.csv: each line contains name of a character followed by the relative times when the character is mentioned in the screenplay. I used this data to generate character timelines. The values were computed as

     episode number + scene number/number of scenes in episode
    

    Values [0,1] correspond to mentions in Episode I, [1,2] to Episode II etc.

    [Note that this is not a valid csv file because each line contains a different number of columns]

The folder networks contains:

  • starwars-episode-N-interactions.json contains the social network extracted from Episode N, where the links between characters are defined by the times the characters speak within the same scene.
  • starwars-episode-N-mentions.json contains the social network extracted from Episode N, where the links between characters are defined by the times the characters are mentioned within the same scene.
  • starwars-episode-N-interactions-allCharacters.json is the interactions network with R2-D2 and Chewbacca added in using data from mentions network.
  • starwars-full-... contain the corresponding social networks for the whole set of 6 episodes.

The other files contain the code used to generate the data files and the plots.

  • interactions.html and episode-interactions.html contain the D3.js code to visualize the networks.
  • The rest of the code is in F# and uses FsLab
  • To run the code, use paket reference manager to download all the dependencies

starwars-social-network's People

Contributors

evelinag avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.