Data Science, Machine Learning, NLP, Transformers, Word Embeddings.
embedding for the word ‘arthur’ is closer to ‘king’ then to the word ‘table’. from scipy.spatial.distance import cosine kings = cosine(embeddings[0][1], embeddings[0][17]) king_table = cosine(embeddings[0][1], embeddings[0][46]) king_archtur = cosine(embeddings[0][2], embeddings[0][1])