This website is powered by Boxmode. Start your own website now!  Try for free >

TEXT ANALYSIS

Welcome to the text world in Hogwarts

Word Cloud

Hogwarts is divided into four houses, Gryffindor, Hufflepuff, Ravenclaw and Slytherin, every year there is a sorting ceremony for new students. The Sorting Hat will assigns corresponding House based on the student's characteristic. We are wondering what's the most representative words for each house, so we extract the keywords of each house through NLP analysis of Wikipages.

First, we try to use TF-IDF to find the key words. Unfortunately the result of TF-IDF is inconsistent with our expectations, the keys words of each house is similar, which can't show the unique characteristic of each House. We think that's because we only have five documents, use IDF as the weight of each word is not so much useful.
 

We refer to lecture 7 of last year, in which introduced a way called TF-TR, may suitable for small sample.Through TF-TR, we get the top 10 words of each house, the result is shown in below.

It’s looks like we get some meaningful keywords, we use WordCloud to visualize the result of each house. Let’s see our result!

Gryffindor Gryffindor values courage, bravery, nerve, and chivalry. From the worcloud, we can find some words such as competitive, good and fridenly, these words correspond with the Gryffindor's values. Besides, we also see some familiar name, such as ginny, wormtail. eventhough we have already filter the character's name when we generate the wordcloud, but we only filter by their full name, rather than nick name. Ginny and wormtail are also important person in Gryffindor, so it’s not werid to see their names in the word cloud.

Hufflepuff Hufflepuff values hard work, patience, justice, and loyalty. According to Rowling, Hufflepuff corresponds roughly to the element of earth. Unlucky we can't find such word in the wordcloud. On the contrary, we found some interesting names: tina,newt etc. They belong to Fantastic Beasts and Where to Find Them and also appeared in Harry Potter series. Newt is a famous student of Hufflepuff, that's why his name appears in the Hufflepuff wordcloud.

Ravenclaw Ravenclaw values intelligence, learning, wisdom and wit. The house mascot is an eagle and the house colors are blue and bronze. Key words such as beliefs, honorary meet their qualities. It's very funny that some key words are charm, such as verdimillious and transmogrifian. Maybe because the students of Ravenclaw always talk about study.

Slytherins The Sorting Hat claims that blood purity is a factor in selecting Slytherins, that Muggle-born students are not sorted there, merely that pure-blooded students are more desirable to that house. From the wordcloud, we can see the most significant word is bloodline, which is reasonable.

Character word cloud High-frequency word cloud of some main characters in the story  

From the sentiment distribution of characters which has been shown in below, we could find out that the emotional of most characters is very neutral. In the book, some characters are very happy and some characters are vey sad, it is very evenly distributed. And in the wiki page, it's looks like there are more characters and sad and less characters are happy. It may because the wikipage is written by the fans, not only one person, and different person will have different feelings to characters, so the emotion distribution is a little uneven.

Next let's see the top 10 happiness characters and sadness characters individually.

Top10 Happiness and Sadness Characters in book

Top10 Happiness and Sadness Characters in Wiki page

From the above table, we could find out the result in book is different with in wikipage. As we already mentioned in the distribution, that the emotion in book is stronger than emotion in wikipage.


For the characters who are most happiness, we could find out they are all obsessed with their hobbies and very success. Take the most happiest character in the book Barnabus Finkley as example, Barnabus Finkley was a wizard and the Barnabus Finkley Prize for Exceptional Spell-Casting was named in his honour. Thus, he was presumably an exceptional spell-caster. A successful career is indeed a very happy thing.


For the characters who are most sadness, they all have their own sad story. Take the Tom Riddle Senior as example, he is The Dark Lord's father, and finally murdered by his son, Tom Marvolo Riddle.


Then let’s see the sentiment of each house. Left table for books, right tables for Wiki page.

From the above table, we could find out that both house sentiment in book and in Wikipage don't have obvious difference. Even though some of them sentiment score are positive, some are negative, but the actual difference is very small, which is far away from our expectation. We thought Gryffindor may be the happiest house and Slytherin may be saddest House. However, the result is not.
 

From all of these four houses, Hufflepuff is the happies house. Hufflepuff was the most inclusive among the four houses, valuing hard work, dedication, patience, loyalty, and fair play rather than a particular aptitude in its members. Perhaps, it is precisely because of these characteristics that all students feel accepted in Hufflepuff, so they all live happy.


Slytherin is the saddest house. Maybe it's because in the Harry Potter story, many students of Slytherin are villains, such as Lord Voldemort, Malfoy family etc.

© 2021 

Powered by Boxmode

. All rights reserved. 

Privacy Policy