In [1]:
from gensim.models import Word2Vec

In [2]:
bin_file='/Users/arman/word2vec-mac/vectors.bin'
model = Word2Vec.load_word2vec_format(bin_file, binary=True)

Try the followings:


In [3]:
model.most_similar(positive=['italy', 'paris'], negative=['rome'])


Out[3]:
[('france', 0.5196207761764526),
 ('belgium', 0.503353476524353),
 ('switzerland', 0.4783351421356201),
 ('netherlands', 0.43961939215660095),
 ('germany', 0.43092644214630127),
 ('spain', 0.4166962504386902),
 ('luxembourg', 0.4046187996864319),
 ('poissy', 0.40096890926361084),
 ('anterselva', 0.39855581521987915),
 ('ghent', 0.3946520686149597)]

In [4]:
model.most_similar(positive=['grandfather','mother'],negative=['father'])


Out[4]:
[('grandmother', 0.6169962286949158),
 ('paternal', 0.6016992926597595),
 ('grandparents', 0.6010604500770569),
 ('clytemnestra', 0.551709771156311),
 ('livia', 0.5436491966247559),
 ('niece', 0.5430512428283691),
 ('uncle', 0.542066216468811),
 ('siblings', 0.5365633368492126),
 ('cousin', 0.5325353145599365),
 ('aunt', 0.5313519239425659)]

In [5]:
model.most_similar(positive=['night', 'sun'], negative=['day'])


Out[5]:
[('moon', 0.45611095428466797),
 ('sky', 0.44355136156082153),
 ('planet', 0.41315507888793945),
 ('penumbra', 0.40174463391304016),
 ('earth', 0.4008573293685913),
 ('orbit', 0.38683050870895386),
 ('stars', 0.37469831109046936),
 ('star', 0.37204569578170776),
 ('orbited', 0.36725711822509766),
 ('shines', 0.36202704906463623)]

In [6]:
model.most_similar(positive=['air', 'car'], negative=['street'])


Out[6]:
[('aircraft', 0.4351119101047516),
 ('usaf', 0.4198461174964905),
 ('sulphur', 0.41753703355789185),
 ('tankers', 0.415522038936615),
 ('refueling', 0.4153955578804016),
 ('aircrew', 0.4133361279964447),
 ('force', 0.4132561683654785),
 ('helicopters', 0.40959489345550537),
 ('airliner', 0.4093279540538788),
 ('usaaf', 0.4003691077232361)]

In [7]:
model.most_similar(positive=['small','cold'],negative=['large'])


Out[7]:
[('warm', 0.5112459659576416),
 ('winters', 0.4805816411972046),
 ('dry', 0.4719161093235016),
 ('hot', 0.46762076020240784),
 ('wet', 0.4517703652381897),
 ('mild', 0.43643802404403687),
 ('summers', 0.4337451457977295),
 ('cool', 0.42903345823287964),
 ('humid', 0.4109804928302765),
 ('cloudy', 0.3974928855895996)]

In [8]:
model.most_similar(positive=['art','experiment'],negative=['science'])


Out[8]:
[('painting', 0.31739097833633423),
 ('baroque', 0.28513896465301514),
 ('architectural', 0.27554619312286377),
 ('alberti', 0.268780380487442),
 ('antiproton', 0.2659834027290344),
 ('architecture', 0.2656795382499695),
 ('audience', 0.2637186050415039),
 ('sculptures', 0.25843268632888794),
 ('idealization', 0.2583766579627991),
 ('sculpture', 0.25550577044487)]

In [9]:
model.most_similar(positive=['men','car'],negative=['man'])


Out[9]:
[('cars', 0.5231117010116577),
 ('racing', 0.4547455608844757),
 ('motorcycles', 0.426320344209671),
 ('motorcycle', 0.42629945278167725),
 ('vehicles', 0.395269513130188),
 ('driver', 0.38971585035324097),
 ('trucks', 0.3887791633605957),
 ('automobile', 0.38580387830734253),
 ('bmw', 0.36683720350265503),
 ('limousines', 0.36580947041511536)]

In [ ]: