close
The Wayback Machine - https://web.archive.org/web/20201224225914/https://github.com/chatopera/Synonyms/issues/64
Skip to content
This repository has been archived by the owner. It is now read-only.

句子的相似度计算方法是什么? #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

@bigrat911 bigrat911 commented May 30, 2018

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

@Samurais
Copy link
Member

@Samurais Samurais commented Jun 6, 2018

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

image

@Samurais Samurais closed this Jun 6, 2018
Samurais added a commit that referenced this issue Jun 6, 2018
@wuyang0329
Copy link

@wuyang0329 wuyang0329 commented Jul 17, 2018

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

@Samurais
Copy link
Member

@Samurais Samurais commented Jul 17, 2018

曲线形状

@wuyang0329
Copy link

@wuyang0329 wuyang0329 commented Jul 18, 2018

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

@fremcode
Copy link

@fremcode fremcode commented Jan 15, 2019

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

@Samurais
Copy link
Member

@Samurais Samurais commented Jan 15, 2019

@AlexYoung757
Copy link

@AlexYoung757 AlexYoung757 commented Apr 2, 2019

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

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

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

@luluyouyue
Copy link

@luluyouyue luluyouyue commented Jul 3, 2019

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

@NancyGu
Copy link

@NancyGu NancyGu commented Apr 15, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.