https://github.com/bububa/cilin
基于哈工大同义词词林扩展版的单词相似度计算方法
https://github.com/bububa/cilin
cilin nlp similarity word-similarity
Last synced: 5 months ago
JSON representation
基于哈工大同义词词林扩展版的单词相似度计算方法
- Host: GitHub
- URL: https://github.com/bububa/cilin
- Owner: bububa
- License: apache-2.0
- Created: 2021-07-06T09:11:35.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-06T09:15:58.000Z (almost 4 years ago)
- Last Synced: 2024-12-16T20:32:21.153Z (5 months ago)
- Topics: cilin, nlp, similarity, word-similarity
- Language: Go
- Homepage:
- Size: 412 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 同义词词林扩展版
[](https://pkg.go.dev/github.com/bububa/cilin)
[](https://github.com/bububa/cilin/actions/workflows/go.yml)
[](https://github.com/bububa/cilin/actions/workflows/goreleaser.yml)
[](https://github.com/bububa/cilin)
[](https://goreportcard.com/report/github.com/bububa/cilin)
[](https://github.com/bububa/cilin/blob/master/LICENSE)
[](https://GitHub.com/bububa/cilin/releases/)Word similarity computation based on Tongyici Cilin.
这是一个基于哈工大同义词词林扩展版的单词相似度计算方法的golang实现,参考论文如下:
2010 田久乐等,吉林大学学报(信息科学版),基于同义词词林的词语相似度计算方法。## Install
go get -u github.com/bububa/cilin## Usage
```golang
import "github.com/bububa/cilin"cs := cilin.NewSimilarity()
w1 := "抄袭"
w2 := "克隆"
sim := cs.Calculate(w1, w2)
fmt.Printf("%s %s 相似度为 %f\n", w1, w2, sim)
// 抄袭 克隆 相似度为 0.585642777645155w1 = "人民"
lst := []string{"国民", "群众", "党群", "良民", "同志", "成年人", "市民", "亲属", "志愿者", "先锋"}
for _, w2 := range lst {
sim := s.Calculate(w1, w2)
fmt.Printf("%s %s, 相似度:%f\n", w1, w2, sim)
}// 人民 国民, 相似度:1.000000
// 人民 群众, 相似度:0.957661
// 人民 党群, 相似度:0.897808
// 人民 良民, 相似度:0.718246
// 人民 同志, 相似度:0.663015
// 人民 成年人, 相似度:0.630692
// 人民 市民, 相似度:0.540593
// 人民 亲属, 相似度:0.360396
// 人民 志愿者, 相似度:0.225247
// 人民 先锋, 相似度:0.180198
```## 同类项目
-
- https://github.com/ashengtx/CilinSimilarity 实现了三种计算方法。
- https://github.com/Xls1994/Cilin
- http://www.codepub.cn/2015/08/04/Based-on-the-extended-version-of-synonyms-Cilin-word-similarity-computing/ Java实现## 致谢
本代码的实现要感谢下面几位作者:
* 哈工大信息检索研究室所著的《哈工大信息检索研究室同义词词林扩展版》
* 田久乐 赵 蔚在2010年所发表论文<基于同义词词林的词语相似度计算方法>
* http://codepub.cn/2015/08/04/Based-on-the-extended-version-of-synonyms-Cilin-word-similarity-computing/
* http://www.cnblogs.com/einyboy/archive/2012/09/09/2677265.html?from=singlemessage&isappinstalled=0
* 本代码参考了https://github.com/ashengtx/CilinSimilarity 部分实现