Presented by T毛可以吃泡芙嗎
Berlin - Germany = Paris - France
print( numpy.linalg.norm( model['brave'] - model['Gryffindor'] ) )
print( numpy.linalg.norm( model['brave'] - model['Hufflepuff'] ) )
print( numpy.linalg.norm( model['brave'] - model['Ravenclaw'] ) )
print( numpy.linalg.norm( model['brave'] - model['Slytherin'] ) )跟預期結果不符!!
print(model.most_similar('Gryffindor', topn=10)print(model.most_similar('brave', topn=10)文本中學院與其特質間的描述不足
計算單字與該學院特質的平均距離
並取平均距離最短的學院
平均距離最短的是Gryffindor
基本概念就是總距離越短越相近
不同顏色代表不同學院
最短
| Gryffindor | Hufflepuff | Ravenclaw | Slytherin | |
|---|---|---|---|---|
| A1 | H | H | H | S |
| A2 | H | H | H | S |
| A3 | G | H | R | S |
Hermione was noted for being extremely intelligent and hard-working, coming out on top in most of her classes and continuously aiding Harry and Ron in their adventures.
She was so studious that the school gave her a Time-Turner in her third year, a device that rewinds time so that she could take extra courses.
Because of her efficiency, she often had time to do hobby work on the side, such as preparing a defence for Buckbeak to save him from execution, and creating S.P.E.W., an organisation promoting the freedom of house-elves.
Such acts demonstrate Hermione's social conscience, tenacity, and compassion.
Unlike most wizards who depended solely on their magical ability, Hermione readily relied on logic.
Although this often helped her cleverly deduce information that many others missed, such as Remus Lupin's lycanthropy, Hermione's emphasis on logic also made her sceptical about accepting anything without proof, as opposed to Harry who would come to intuitive conclusions.
For example, she completely dismissed the idea of the Deathly Hallows, refusing to believe in them without physical evidence.
Hermione was quite responsible, perfectionistic, and well put-together, which led to her being made a prefect during her fifth year.
Throughout her entire school career, Hermione was insistent on order and steadfastly devoted to the rules, at the expense of her popularity.
Her sense of humour was limited; she frequently expressed disapproval over Fred and George's practical jokes and threatened to put them in detention for selling prank items in the common room.
She often attempted to act as the voice of reason among her more impulsive friends, to varying levels of success.
However, in spite of her strait-laced disposition, Hermione was not above using coercion and threats to get what she wanted, as is evidenced by her blackmailing Rita Skeeter into writing a good article about Harry.
Hermione was not afraid to stand up to her friends when she thought it was in their best interests, or when she felt they were wrong; she risked angering Harry by getting his Firebolt confiscated because she feared it might be jinxed, and argued with both him and Ginny over his use of the shady Half Blood Prince's textbook.
Hermione was very determined and focused, in that she "always [kept] her attention focused on the job that must be done."
Her refusal to break under torture shows her strength of willpower.
Hermione demonstrated her bravery many times when facing danger, though she initially showed a tendency toward mild panic in the sudden situations She was extremely loyal to her friends, risking her life frequently to help them and standing by Harry even when no one else did.
She also gave them advice rather often, such as in trying to make Harry understand Cho Chang's behaviour on their date, and in helping Ginny deal with her crush on Harry; this once prompted Ron to advise her to write a book to translate all the "mad things"
Hermione was quite blunt with her opinions, sometimes to the point of being tactless; for example, her attempt to comfort Lavender Brown about the death of her rabbit did not go over well, and her honesty when dealing with centaurs in 1996 nearly landed her and Harry in serious trouble.
Despite this, Hermione was generally sensitive to others' emotions, and would lie when she had to, though she was not a skilled liar.
Hermione also tended to be rather argumentative, a trait most evident in her interactions with Ron.
Although she was generally not as short-tempered as her friends, she displayed a formidable one on several occasions, such as slapping Draco Malfoy in defence of Hagrid, sabotaging Cormac McLaggen's tryout as a Keeper for the Gryffindor Quidditch team after he insulted Ron and Ginny, conjuring a flock of canaries to attack Ron in their sixth year and physically attacking Ron when he briefly abandoned her and Harry during their hunt for Horcruxes. Hermione Granger
gensim
https://radimrehurek.com/gensim/models/word2vec.html
http://harrypotter.wikia.com/wiki/Main_Page