MaoXinn / SEU

30 stars 4 forks source link

请问这里做范数归一化的作用是什么呢 #5

Closed kyleeea closed 2 years ago

kyleeea commented 2 years ago

ent_vec[i] = ent_vec[i] / np.linalg.norm(ent_vec[i]) char_vec[i] = char_vec[i] / np.linalg.norm(char_vec[i])

MaoXinn commented 2 years ago

为了让向量内积的结果变成余弦相似度。 这个小trick应该在很多领域都存在。