ONNX 模型库
返回模型

说明文档

LightEmbed/sbert-paraphrase-multilingual-MiniLM-L12-v2-onnx

这是 Sentence Transformers 模型 sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 的 ONNX 版本,用于句子嵌入,针对速度和轻量级性能进行了优化。通过使用 onnxruntime 和 tokenizers 而非 sentence-transformers 和 transformers 等较重的库,该版本确保了更小的库体积和更快的执行速度。以下是该模型的详细信息:

  • 基础模型:sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
  • 嵌入维度:384
  • 最大序列长度:128
  • 磁盘文件大小:0.44 GB
  • 包含池化层:是

此 ONNX 模型包含原始句子转换器模型中的所有组件: Transformer、Pooling

<!--- 在此描述您的模型 -->

使用方法 (LightEmbed)

安装 LightEmbed 后,使用该模型变得非常简单:

pip install -U light-embed

然后您可以使用原始模型名称来使用该模型,如下所示:

from light_embed import TextEmbedding
sentences = [
	"This is an example sentence",
	"Each sentence is converted"
]

model = TextEmbedding('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
embeddings = model.encode(sentences)
print(embeddings)

您也可以使用 ONNX 模型名称来使用该模型,如下所示:

from light_embed import TextEmbedding
sentences = [
	"This is an example sentence",
	"Each sentence is converted"
]

model = TextEmbedding('LightEmbed/sbert-paraphrase-multilingual-MiniLM-L12-v2-onnx')
embeddings = model.encode(sentences)
print(embeddings)

引用与作者

Binh Nguyen / binhcode25@gmail.com

LightEmbed/sbert-paraphrase-multilingual-MiniLM-L12-v2-onnx

作者 LightEmbed

sentence-similarity light-embed
↓ 1 ♥ 0

创建时间: 2024-05-14 22:41:39+00:00

更新时间: 2024-07-07 19:50:42+00:00

在 Hugging Face 上查看

文件 (14)

.gitattributes
1_Pooling/config.json
README.md
config.json
config_sentence_transformers.json
model.onnx ONNX
model_description.json
model_info.json
modules.json
sentence_bert_config.json
special_tokens_map.json
tokenizer.json
tokenizer_config.json
unigram.json