Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

TextMatch

> 编程语言
Open source

基于Pytorch的,中文语义相似度匹配模型(ABCNN、Albert、Bert、BIMPM、DecomposableAttention、DistilBert、ESIM、RE2、Roberta、SiaGRU、XlNet)

796 stars0 likes1 views
WebsiteGitHub

About

基于Pytorch的,中文语义相似度匹配模型(ABCNN、Albert、Bert、BIMPM、DecomposableAttention、DistilBert、ESIM、RE2、Roberta、SiaGRU、XlNet)

基于Pytorch的中文语义相似度匹配模型

基于Pytorch的中文语义相似度匹配模型

本项目将持续更新,对比目前业界主流文本匹配模型在中文的效果

运行环境: python3.7、pytorch1.2、transformers2.5.1

数据集采用LCQMC数据(将一个句对进行分类,判断两个句子的语义是否相同(二分类任务)),因数据存在侵权嫌疑,故不提供下载,需要者可向官方提出数据申请http://icrc.hitsz.edu.cn/info/1037/1146.htm ,并将数据解压到data文件夹即可。模型评测指标为:ACC,AUC以及预测总共耗时。

Embeding:
本项目输入都统一采用分字策略,故通过维基百科中文语料,训练了字向量作为Embeding嵌入。训练语料、向量模型以及词表,可通过百度网盘下载。
链接:https://pan.baidu.com/s/1qByw67GdFSj0Vt03GSF0qg
提取码:s830

模型文件:
本项目训练的模型文件(不一定最优,可通过超参继续调优),也可通过网盘下载。
链接:https://pan.baidu.com/s/1qByw67GdFSj0Vt03GSF0qg
提取码:s830

测试集结果对比:

模型 ACC AUC 耗时(s)(备注:环境1070TI)
ABCNN 0.8081 0.9059 4.6260
Albert 0.8522 0.9475 52.3823
Bert 0.8714 0.9544 61.2800
BIMPM 0.8359 0.9375 18.8210
DecomposableAttention 0.8068 0.9334 3.7170
DistilBert 0.8450 0.9403 31.1680
ESIM 0.8385 0.9311 2.7410
RE2 0.8391 0.9196 5.2200
Roberta 0.8726 0.9591 61.3130
SiaGRU 0.8281 0.9336 3.5500
XlNet 0.8694 0.9601 89.8090

部分模型,借鉴了
https://github.com/alibaba-edu/simple-effective-text-matching-pytorch
https://github.com/pengshuang/Text-Similarity
等项目。

Issues· 12 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言