Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

句子的相似度计算方法是什么? #64

Closed
bigrat911 opened this issue May 30, 2018 · 9 comments
Closed

句子的相似度计算方法是什么? #64

bigrat911 opened this issue May 30, 2018 · 9 comments

Comments

@bigrat911
Copy link

比如,句子的向量表示为每个词的vector取平均,然后cos
或者用softcos、WMD之类?

@hailiang-wang
Copy link
Member

  • 使用词向量和编辑距离
  • 根据词向量距离,采取梯度方式设置权重
  • 采取平滑策略

image

hailiang-wang added a commit that referenced this issue Jun 6, 2018
@wuyang0329
Copy link

请问这个平滑策略的根据是什么呢,谢谢!

@hailiang-wang
Copy link
Member

曲线形状

@wuyang0329
Copy link

还有两个问题想问一下您,您的代码中_flat_sum_array这个函数是将句子中各个词的词向量叠加吗?
还有nearby_levenshtein_distance这个函数是将两个句子计算出来的编辑距离做了归一化吗?

@fremcode
Copy link

请教一下,是我用法不对还是词库的问题,"舒服"的近义词为什么是"难受"?

@hailiang-wang
Copy link
Member

hailiang-wang commented Jan 15, 2019 via email

@AlexYoung757
Copy link

句子相似度比较每次得到的结果居然不一致。。。
第一次运行结果:
相似度:1.0
相似度:0.304
相似度:0.626

第二次运行结果:
相似度:1.0
相似度:0.326
相似度:0.635

第三次运行结果:
相似度:1.0
相似度:0.291
相似度:0.618

@luluyouyue
Copy link

为什么是词向量相似度和编辑距离相似度相乘而不是相加呢?

@NancyGu
Copy link

NancyGu commented Apr 15, 2020

在这个问题下学到很多,我的理解是:
1- 用编辑距离和词向量相似度cos值相乘
cos起到方向上的修正作用
2-word2vec是根据上下文做推断,的确有无法区分同义词和反义词的问题
3-词权,我刚看到一种单个文档自适应设词权的方法
用的是词向量-文档中所有词池化后的向量 = 权重

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants