MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / nearest_neighbors

Function nearest_neighbors

nlp_class2/pretrained_w2v.py:42–46  ·  view source on GitHub ↗
(w)

Source from the content-addressed store, hash-verified

40 print("%s - %s = %s - %s" % (w1, w2, r[0][0], w3))
41
42def nearest_neighbors(w):
43 r = word_vectors.most_similar(positive=[w])
44 print("neighbors of: %s" % w)
45 for word, score in r:
46 print("\t%s" % word)
47
48
49find_analogies('king', 'man', 'woman')

Callers 1

pretrained_w2v.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected