Giter VIP home page Giter VIP logo

witcher_project's Introduction

witcher_project

This project analyzes the 2nd book in The Witcher series, The Sword of Destiny, and visualizes character importance in the second book of the series and the importance of characters throughout the entire series. I used Selenium to scrape the witcher wiki page. After cleaning it, I used Spacy to analyze the data and Networkx and Pyvis to visualize the data in a meaningful way.

Extraction Strategy

There are several methods to extract relationships from text. However, currently available deep learning models are often trained on a specific dataset and would not be suited for fantasy novels. I decided to go with a simple Named Entity Recognition model with a few rules

  1. Every book is tokenized into a large list of sentences
  2. I label every sentence by the name of the character(s) that appear in them
  3. I define a window size of how far 2 sentences are apart from eachother and assume that if 2 characters are mentions in 2 sentences within this window then their is a relationship between them

Overview

main_visualization

Through my analysis, I learned that the 2nd book in The Witcher series, The Sword of Destiny, contains a varying level of importance of character throughout the book with the most important characters being Geralt, Yennefer, and Ciri. Geralt had a much larger importance, indicating that he is the main character with Ciri and Yennefer being close to him. I addition, I can conclude from my data that he had the most relationships with "side characters" throughout the book.

Importance_over_series

Next, I took the top 5 characters based on importance from my analysis of the 2nd book in the series and visualized their importance throughout the first 8 books in the series. As expected, the level of importance of the character remained similar to the importance in the second book. However, the their is no data for Ciri for the 1st book. This is because she is born in the second book. She then rises to the most important character for books 5 and 6 before Geralt becomes the most important character once again for book 8. This was an interesting discovery and I enjoyed being able to visualize how the events throughout each book affected each characters importance over the course of the series.

witcher_project's People

Contributors

theahmir 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.