余弦相似度和欧氏距离
![Image for post](https://miro.medium.com/max/9999/1*-sFwTHsMYUItQRYpfi9gaw.jpeg)
This is a quick and straight to the point introduction to Euclidean distance and cosine similarity with a focus on NLP.
这是对欧氏距离和余弦相似度的快速而直接的介绍,重点是NLP。
欧氏距离 (Euclidean Distance)
The Euclidean distance metric allows you to identify how far two points or two vectors are apart from each other.
欧几里德距离度量标准可让您确定两个点或两个向量彼此相距多远。
Now suppose you are a high school student and you have three classes. A math class, a philosophy class, and a psychology class. You want to check the similarity between these classes based on the words your professors use in class. For the sake of simplicity, let’s consider these two words: “theory” and “harmony”. You could then create a table like this to record the occurrence of these words in each class:
现在假设您是