🚀 越南语嵌入模型
越南语嵌入模型是一个从BGE - M3模型(https://huggingface.co/BAAI/bge - m3)微调而来的嵌入模型,旨在增强越南语的检索能力。
🚀 快速开始
越南语嵌入模型是基于BGE - M3模型微调的,用于提升越南语的检索性能。以下是使用该模型的示例代码:
from sentence_transformers import SentenceTransformer
import torch
model = SentenceTransformer("AITeamVN/Vietnamese_Embedding")
model.max_seq_length = 2048
sentences_1 = ["Trí tuệ nhân tạo là gì", "Lợi ích của giấc ngủ"]
sentences_2 = ["Trí tuệ nhân tạo là công nghệ giúp máy móc suy nghĩ và học hỏi như con người. Nó hoạt động bằng cách thu thập dữ liệu, nhận diện mẫu và đưa ra quyết định.",
"Giấc ngủ giúp cơ thể và não bộ nghỉ ngơi, hồi phục năng lượng và cải thiện trí nhớ. Ngủ đủ giấc giúp tinh thần tỉnh táo và làm việc hiệu quả hơn."]
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)
'''
✨ 主要特性
- 该模型在约300,000个越南语的查询、正文档和负文档三元组上进行训练。
- 模型训练时的最大序列长度为2048。
📚 详细文档
模型详情
属性 |
详情 |
模型类型 |
句子转换器 |
基础模型 |
[BAAI/bge - m3](https://huggingface.co/BAAI/bge - m3) |
最大序列长度 |
2048个标记 |
输出维度 |
1024维 |
相似度函数 |
点积相似度 |
语言 |
越南语 |
许可证 |
Apache 2.0 |
评估
- 数据集:2021年Legal Zalo的整个训练数据集,本模型未在该数据集上进行训练。
模型 |
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 (public) |
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在1100000个三元组上进行训练。虽然Vietnamese_Embedding_v2在法律领域的得分略有下降,但由于该阶段的数据量更大,它在其他领域表现良好。
你可以通过以下链接访问两个模型:Vietnamese_Embedding_v2,Vietnamese_Reranker。你可以通过运行Python代码evaluation_model.py
(数据从Kaggle下载)来复现评估结果。
📄 许可证
本模型使用的许可证为Apache 2.0。
👥 联系信息
- 邮箱:nguyennhotrung3004@gmail.com
- 开发者:Nguyễn Nho Trung, Nguyễn Nhật Quang
📖 引用
@misc{Vietnamese_Embedding,
title={Vietnamese_Embedding: Embedding model in Vietnamese language.},
author={Nguyen Nho Trung, Nguyen Nhat Quang},
year={2025},
publisher={Huggingface},
}