d*****u 发帖数: 17243 | 1 码公自然秒懂
In [1]: import gensim
In [2]: model = gensim.models.Word2Vec.load_word2vec_format('GoogleNews-
vectors-negative300.bin', binary=True)
In [3]: model.similarity('ape', 'African')
Out[3]: 0.25142862328465004
In [4]: model.similarity('ape', 'Asian')
Out[4]: 0.18625269574220088
In [5]: model.similarity('ape', 'European')
Out[5]: 0.034847314905568472
In [6]: model.similarity('ape', 'monkey')
Out[6]: 0.61702215284369433 | y****o 发帖数: 1535 | | s*****l 发帖数: 7106 | 3 你还不如用图像
Unsupervised cluster | d*****u 发帖数: 17243 | 4 language model可以做很多事情
比如:
In [88]: model.most_similar(positive=['woman', 'king'], negative=['man'],
topn=1)
Out[88]: [(u'queen', 0.711819589138031)]
【在 s*****l 的大作中提到】 : 你还不如用图像 : Unsupervised cluster
|
|