Views
No views yet
1from sentence_transformers import SentenceTransformer
2import torch
3
4model = SentenceTransformer("AITeamVN/Vietnamese_Embedding_v2")
5model.max_seq_length = 2048
6sentences_1 = ["Trí tuệ nhân tạo là gì", "Lợi ích của giấc ngủ"]
7sentences_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.",
8 "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."]
9query_embedding = model.encode(sentences_1)
10doc_embeddings = model.encode(sentences_2)
11similarity = query_embedding @ doc_embeddings.T
12print(similarity)
13
14'''
15array([[0.66212064, 0.33066642],
16 [0.25866613, 0.5865289 ]], dtype=float32)
17'''| Model | 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 |
1@misc{Vietnamese_Embedding,
2 title={Vietnamese_Embedding: Embedding model in Vietnamese language.},
3 author={Nguyen Nho Trung, Nguyen Nhat Quang, Nguyễn Văn Huy},
4 year={2025},
5 publisher={Huggingface},
6}