July 2018
Intermediate to advanced
474 pages
13h 37m
English
Consider the following:
def nearest_similarity_cosmul(start1, end1, end2): similarities = got2vec.most_similar_cosmul( positive=[end2, start1], negative=[end1])start2 = similarities[0][0]print("{start1} is related to {end1}, as {start2} is related to {end2}".format(**locals()))return start2
nearest_similarity_cosmul("Stark", "Winterfell", "Riverrun")nearest_similarity_cosmul("Jaime", "sword", ...Read now
Unlock full access