模型介绍
中文整理以下内容同HuggingFace,仅用于方便国内用户下载使用,仅个人出于方便使用目的上传,如有侵权立刻删除。官方地址**
特别鸣谢: 感谢不愿透露姓名的李某提供网费下载模型。
shibing624/text2vec-base-chinese
This is a CoSENT(Cosine Sentence) model: shibing624/text2vec-base-chinese.
It maps sentences to a 768 dimensional dense vector space and can be used for tasks
like sentence embeddings, text matching or semantic search.
Evaluation
For an automated evaluation of this model, see the *Evaluation Benchmark*: text2vec
chinese text matching task:
Arch BaseModel Model ATEC BQ LCQMC PAWSX STS-B SOHU-dd SOHU-dc Avg QPS
:----------- :---------------------------------- :-------------------------------------------------------------------------------------------------------------------------------------------------- :-----: :-----: :-----: :-----: :-----: :-------: :-------: :---------: :-----:
Word2Vec word2vec w2v-light-tencent-chinese 20.00 31.49 59.46 2.57 55.78 55.04 20.70 35.03 23769
SBERT xlm-roberta-base sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 18.42 38.52 63.96 10.14 78.90 63.01 52.28 46.46 3138
Instructor hfl/chinese-roberta-wwm-ext moka-ai/m3e-base 41.27 63.81 74.87 12.20 76.96 75.83 60.55 57.93 2980
CoSENT hfl/chinese-macbert-base shibing624/text2vec-base-chinese 31.93 42.67 70.16 17.21 79.30 70.27 50.42 51.61 3008
CoSENT hfl/chinese-lert-large GanymedeNil/text2vec-large-chinese 32.61 44.59 69.30 14.51 79.44 73.01 59.04 53.12 2092
CoSENT nghuyong/ernie-3.0-base-zh shibing624/text2vec-base-chinese-sentence 43.37 61.43 73.48 38.90 78.25 70.60 53.08 59.87 3089
CoSENT nghuyong/ernie-3.0-base-zh shibing624/text2vec-base-chinese-paraphrase 44.89 63.58 74.24 40.90 78.93 76.70 63.30 63.08 3066
CoSENT sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 shibing624/text2vec-base-multilingual 32.39 50.33 65.64 32.56 74.45 68.88 51.17 53.67 4004
说明:
结果评测指标:spearman系数
shibing624/text2vec-base-chinese 模型,是用CoSENT方法训练,基于 hfl/chinese-macbert-base 在中文STS-B数据训练得到,并在中文STS-B测试集评估达到较好效果,运行examples/training sup text matching model.py代码可训练模型,模型文件已经上传HF model hub,中文通用语义匹配任务推荐使用
shibing624/text2vec-base-chinese-sentence 模型,是用CoSENT方法训练,基于 nghuyong/ernie-3.0-base-zh 用人工挑选后的中文STS数据集shibing624/nli-zh-all/text2vec-base-chinese-sentence-dataset训练得到,并在中文各NLI测试集评估达到较好效果,运行examples/training sup text matching model jsonl data.py代码可训练模型,模型文件已经上传HF model hub,中文s2s(句子vs句子)语义匹配任务推荐使用
shibing624/text2vec-base-chinese-paraphrase 模型,是用CoSENT方法训练,基于 nghuyong/ernie-3.0-base-zh 用人工挑选后的中文STS数据集shibing624/nli-zh-all/text2vec-base-chinese-paraphrase-dataset,数据集相对于shibing624/nli-zh-all/text2vec-base-chinese-sentence-dataset加入了s2p(sentence to paraphrase)数据,强化了其长文本的表征能力,并在中文各NLI测试集评估达到SOTA,运行examples/training sup text matching model jsonl data.py代码可训练模型,模型文件已经上传HF model hub,中文s2p(句子vs段落)语义匹配任务推荐使用
sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 模型是用SBERT训练,是 paraphrase-MiniLM-L12-v2 模型的多语言版本,支持中文、英文等
w2v-light-tencent-chinese 是腾讯词向量的Word2Vec模型,CPU加载使用,适用于中文字面匹配任务和缺少数据的冷启动情况
Usage (text2vec)
Using this model becomes easy when you have text2vec installed:
Then you can use the model like this:
Usage (HuggingFace Transformers)
Without text2vec, you can use the model like this:
First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.
Install transformers:
Then load model and predict:
Usage (sentence-transformers)
sentence-transformers is a popular library to compute dense vector representations for sentences.
Install sentence-transformers:
Then load model and predict:
Full Model Architecture
Intended uses
Our model is intented to be used as a sentence and short paragraph encoder. Given an input text, it ouptuts a vector which captures
the semantic information. The sentence vector may be used for information retrieval, clustering or sentence similarity tasks.
By default, input text longer than 256 word pieces is truncated.
Training procedure
Pre-training
We use the pretrained hfl/chinese-macbert-base model.
Please refer to the model card for more detailed information about the pre-training procedure.
Fine-tuning
We fine-tune the model using a contrastive objective. Formally, we compute the cosine similarity from each
possible sentence pairs from the batch.
We then apply the rank loss by comparing with true pairs and false pairs.
Hyper parameters
training dataset: https://huggingface.co/datasets/shibing624/nli zh
max seq length: 128
best epoch: 5
sentence embedding dim: 768
Citing & Authors
This model was trained by text2vec.
If you find this model helpful, feel free to cite:
优先采用原作者提供的中文模型卡片;仅有英文说明时由闲社AI翻译整理。重要参数、许可证和商用范围请以原文为准。
你将获得什么
完整仓库方式包含该固定版本中的权重、配置、分词器及说明文件;指定版本方式只下载所选文件或整组分片。多模态模型的投影文件、配置等依赖,请按作者说明配齐。
完整仓库可能包含多个权重格式,因此需要的磁盘空间可能大于单一格式的模型大小。下载文件不等于完成模型部署。
使用前须知
运行模型需要的设备、工具与依赖,以原作者说明为准。
是否允许商用、修改和分发,请查看模型许可证。
闲社提供资料与镜像下载方法,不代表已运行模型或完成安全审计。下载的代码应先检查,再执行。
资料或下载有问题?
登录后可提交反馈。
