In [1]:
from gensim.models import Word2Vec
In [3]:
HateModel = Word2Vec.load('../../word2vec_models/hate_model/hate_model.word2vec')
NotHateModel = Word2Vec.load('../../word2vec_models/nothate_model/nothate_model.word2vec')
In [5]:
# List of words to examine:
wordlist = ['hero', 'fat', 'woman', 'man', 'black', 'hispanic', 'boy', 'girl']
In [7]:
for word in wordlist:
print('For word "{0}", Not Hate: '.format(word))
print( NotHateModel.most_similar(word) )
print ''
print('For word "{0}", Hate: '.format(word))
print(HateModel.most_similar(word))
print('---')
For word "hero", Not Hate:
[(u'hero.', 0.9021199941635132), (u'traitor', 0.8486503958702087), (u'hero,', 0.8405750393867493), (u'heroes.', 0.8118383288383484), (u'villain', 0.7770292162895203), (u'pretends', 0.7739084362983704), (u'heroes', 0.7709003686904907), (u'villain.', 0.7688331007957458), (u'martyr', 0.7658681869506836), (u'saint', 0.7578815817832947)]
For word "hero", Hate:
[(u'lapsed', 0.9384522438049316), (u'basement', 0.9146923422813416), (u'hypnotize', 0.9135787487030029), (u're-shapes', 0.9118224382400513), (u'pro-violence.', 0.9061013460159302), (u'assimilates', 0.897411048412323), (u'photoshopping,', 0.8939934968948364), (u'damsel', 0.8907822370529175), (u'creature', 0.889227032661438), (u'Widow', 0.8880250453948975)]
---
For word "fat", Not Hate:
[(u'fat.', 0.9285551309585571), (u'overweight', 0.905987024307251), (u'fat,', 0.898859977722168), (u'obese', 0.8831230401992798), (u'overweight.', 0.8561903238296509), (u'skinny', 0.8536276817321777), (u'overweight,', 0.8404632806777954), (u'unhealthy.', 0.8354079723358154), (u'weight.', 0.8010793924331665), (u'obese.', 0.7881980538368225)]
For word "fat", Hate:
[(u'sluts', 0.9417784214019775), (u'settle', 0.938048243522644), (u'pussy', 0.9356737732887268), (u'fat,', 0.9346773624420166), (u'cheat', 0.930102527141571), (u'thin', 0.922900378704071), (u'girls,', 0.922322154045105), (u'skinny', 0.9221551418304443), (u'starved.', 0.9206138253211975), (u'fit', 0.919164776802063)]
---
For word "woman", Not Hate:
[(u'woman,', 0.9096387624740601), (u'woman.', 0.9036479592323303), (u'man', 0.7876546382904053), (u'male', 0.7290268540382385), (u'herself', 0.7222250699996948), (u'women', 0.719194233417511), (u'girl', 0.7118192911148071), (u'female,', 0.7065656185150146), (u'sexually', 0.7060365676879883), (u'herself,', 0.704866886138916)]
For word "woman", Hate:
[(u'man', 0.9641634225845337), (u'sex', 0.9541383981704712), (u'woman.', 0.9479809999465942), (u'woman,', 0.9281334280967712), (u'marry', 0.9109037518501282), (u'beta', 0.8993389010429382), (u'raped', 0.8971266746520996), (u'alpha', 0.8918324708938599), (u'morbidly', 0.8895968198776245), (u'model.', 0.8856372833251953)]
---
For word "man", Not Hate:
[(u'woman,', 0.7886461019515991), (u'woman', 0.7876546382904053), (u'man,', 0.7722474336624146), (u'woman.', 0.7698383927345276), (u'man.', 0.7457706332206726), (u'mans', 0.7090646624565125), (u'herself,', 0.6679624319076538), (u'wife.', 0.6574730277061462), (u'rapist.', 0.6553009748458862), (u'predator.', 0.6551223993301392)]
For word "man", Hate:
[(u'woman', 0.9641634225845337), (u'woman,', 0.9350082278251648), (u'woman.', 0.9302272200584412), (u'beta', 0.921023964881897), (u'inappropriately,', 0.9125171303749084), (u'sex', 0.9111979007720947), (u'marry', 0.8967803120613098), (u'loser', 0.8956470489501953), (u'betaness.', 0.8944659233093262), (u'child.', 0.8938629031181335)]
---
For word "black", Not Hate:
[(u'white', 0.9401064515113831), (u'white.', 0.8499859571456909), (u'black.', 0.8386881947517395), (u'black,', 0.8152388334274292), (u'white,', 0.8011336326599121), (u'non-white', 0.7659434676170349), (u'blacks', 0.7641212940216064), (u'racism', 0.756743311882019), (u'whites', 0.7428706884384155), (u'Black', 0.7330441474914551)]
For word "black", Hate:
[(u'white', 0.956678032875061), (u'female', 0.9346104860305786), (u'male', 0.9303829669952393), (u'white,', 0.9203647375106812), (u'DOJ.', 0.9165573120117188), (u'white.', 0.9054348468780518), (u'born', 0.8986756801605225), (u'models', 0.8970221877098083), (u'characters', 0.8967750668525696), (u'males', 0.8893125057220459)]
---
For word "hispanic", Not Hate:
[(u'Asian,', 0.9511064291000366), (u'Asian.', 0.9160601496696472), (u'Hispanics', 0.9006523489952087), (u'asian', 0.8998643159866333), (u'non-white', 0.8957726955413818), (u'asians', 0.8910367488861084), (u'hispanic,', 0.8876598477363586), (u'Hispanic', 0.8874446153640747), (u'Latino', 0.8848357796669006), (u'Indian.', 0.8830640316009521)]
For word "hispanic", Hate:
[(u'hetero,', 0.9763599634170532), (u'avatars', 0.9705828428268433), (u'protagonists', 0.9675007462501526), (u'females.', 0.9637057781219482), (u'feminine,', 0.9616372585296631), (u'havers', 0.957862138748169), (u'aesthetic', 0.9577579498291016), (u'females,', 0.9575293064117432), (u'geek', 0.9574661254882812), (u'skinned.', 0.9548418521881104)]
---
For word "boy", Not Hate:
[(u'boy.', 0.8471003770828247), (u'boys.', 0.827390193939209), (u'teenage', 0.8151078224182129), (u'teenager', 0.8106790781021118), (u'girl.', 0.796387791633606), (u'boy,', 0.7860039472579956), (u'frat', 0.7851420044898987), (u'sisters,', 0.7826514840126038), (u'lady', 0.7778945565223694), (u'teased', 0.7756608724594116)]
For word "boy", Hate:
[(u'Her', 0.9443774223327637), (u'Dad', 0.9415871500968933), (u'chatty', 0.9232850074768066), (u'girl', 0.9213541746139526), (u'lady', 0.9184502363204956), (u'dad', 0.9160428643226624), (u'GTA5.', 0.9127532243728638), (u'chick', 0.9071722030639648), (u'daughter', 0.9061979055404663), (u'dated', 0.9048191905021667)]
---
For word "girl", Not Hate:
[(u'girl,', 0.9167008996009827), (u'girl.', 0.9161039590835571), (u'girlfriend', 0.8153783679008484), (u'girls', 0.8029835820198059), (u'girls.', 0.8010073900222778), (u'friend', 0.7966920137405396), (u'creepy', 0.7901852130889893), (u'guy', 0.7888926267623901), (u'boyfriend', 0.7872689366340637), (u'chick', 0.7871856093406677)]
For word "girl", Hate:
[(u'chick', 0.9582207798957825), (u'girl,', 0.9534839391708374), (u'boyfriend', 0.9472540616989136), (u'shes', 0.9399527907371521), (u'girl.', 0.9362885355949402), (u'dated', 0.9322280883789062), (u'dad', 0.926253080368042), (u'girlfriend', 0.92424076795578), (u'gf', 0.9241231083869934), (u'guy.', 0.9224797487258911)]
---
In [ ]:
Content source: mgupta011235/TweetSafe
Similar notebooks: