license: apache-2.0
language:
- vi
base_model:
- BAAI/bge-m3
pipeline_tag: sentence-similarity
library_name: sentence-transformers
tags:
- Embedding
模型卡片:Vietnamese_Embedding
Vietnamese_Embedding是基于BGE-M3模型(https://huggingface.co/BAAI/bge-m3)微调的嵌入模型,旨在增强越南语检索能力。
- 该模型在约30万组越南语查询、正向文档和负向文档三元组上进行训练。
- 训练时最大序列长度为2048。
模型详情
模型描述
- 模型类型: 句子转换器
- 基础模型: BAAI/bge-m3
- 最大序列长度: 2048个标记
- 输出维度: 1024维
- 相似度计算方式: 点积相似度
- 语言: 越南语
- 许可协议: Apache 2.0
使用方法
from sentence_transformers import SentenceTransformer
import torch
model = SentenceTransformer("AITeamVN/Vietnamese_Embedding")
model.max_seq_length = 2048
sentences_1 = ["人工智能是什么", "睡眠的好处"]
sentences_2 = ["人工智能是让机器像人类一样思考和学习的科技。它通过收集数据、识别模式并做出决策来运作。",
"睡眠有助于身体和大脑休息,恢复能量并改善记忆。充足睡眠能让人精神清醒,工作效率更高。"]
query_embedding = model.encode(sentences_1)
doc_embeddings = model.encode(sentences_2)
similarity = query_embedding @ doc_embeddings.T
print(similarity)
'''
array([[0.66212064, 0.33066642],
[0.25866613, 0.5865289 ]], dtype=float32)
'''
评估结果
- 数据集:Legal Zalo 2021完整训练集(本模型未在此数据集上训练)
模型 |
Accuracy@1 |
Accuracy@3 |
Accuracy@5 |
Accuracy@10 |
MRR@10 |
Vietnamese_Reranker |
0.7944 |
0.9324 |
0.9537 |
0.9740 |
0.8672 |
Vietnamese_Embedding_v2 |
0.7262 |
0.8927 |
0.9268 |
0.9578 |
0.8149 |
Vietnamese_Embedding (公开版) |
0.7274 |
0.8992 |
0.9305 |
0.9568 |
0.8181 |
Vietnamese-bi-encoder (BKAI) |
0.7109 |
0.8680 |
0.9014 |
0.9299 |
0.7951 |
BGE-M3 |
0.5682 |
0.7728 |
0.8382 |
0.8921 |
0.6822 |
Vietnamese_Reranker和Vietnamese_Embedding_v2在110万组三元组数据上训练。
虽然Vietnamese_Embedding_v2在法律领域得分略有下降,但由于本阶段数据量更大,在其他领域表现优异。
可通过以下链接访问两个模型:Vietnamese_Embedding_v2、Vietnamese_Reranker
您可以通过运行evaluation_model.py代码复现评估结果(数据从Kaggle下载)。
联系方式
邮箱:nguyennhotrung3004@gmail.com
开发团队
成员:Nguyễn Nho Trung、Nguyễn Nhật Quang
引用
@misc{Vietnamese_Embedding,
title={Vietnamese_Embedding: 越南语嵌入模型},
author={Nguyen Nho Trung, Nguyen Nhat Quang},
year={2025},
publisher={Huggingface},
}