Maximum Sequence Length:
2304 tokens (256 for query and 2048 for passages)
Output Dimensionality:
1024 dimensions
Similarity Function:
Dot product Similarity
Language:
Vietnamese
Licence:
Apache 2.0
Usage
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained('AITeamVN/Vietnamese_Reranker')
model = AutoModelForSequenceClassification.from_pretrained('AITeamVN/Vietnamese_Reranker')
model.eval()
MAX_LENGTH = 2304
pairs = [['Trí tuệ nhân tạo là gì?', '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.'],
['Trí tuệ nhân tạo là gì?', '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.']]
with torch.no_grad():
inputs = tokenizer(pairs, padding=True, truncation=True, return_tensors='pt', max_length=MAX_LENGTH)
scores = model(**inputs, return_dict=True).logits.view(-1, ).float()
print(scores)
'''# tensor([ 7.5590, -9.0743])'''
Evaluation:
Dataset: Entire training dataset of Legal Zalo 2021. Our model was not trained on this dataset.
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
Vietnamese_Reranker and Vietnamese_Embedding_v2 was trained on 1,100,000 triplets.
Although the score on the legal domain drops a bit on Vietnamese_Embedding_v2 (Phase 2), since this phase data is much larger, it is good for other domains.
Vietnamese_Reranker huggingface.co is an AI model on huggingface.co that provides Vietnamese_Reranker's model effect (), which can be used instantly with this AITeamVN Vietnamese_Reranker model. huggingface.co supports a free trial of the Vietnamese_Reranker model, and also provides paid use of the Vietnamese_Reranker. Support call Vietnamese_Reranker model through api, including Node.js, Python, http.
Vietnamese_Reranker huggingface.co is an online trial and call api platform, which integrates Vietnamese_Reranker's modeling effects, including api services, and provides a free online trial of Vietnamese_Reranker, you can try Vietnamese_Reranker online for free by clicking the link below.
AITeamVN Vietnamese_Reranker online free url in huggingface.co:
Vietnamese_Reranker is an open source model from GitHub that offers a free installation service, and any user can find Vietnamese_Reranker on GitHub to install. At the same time, huggingface.co provides the effect of Vietnamese_Reranker install, users can directly use Vietnamese_Reranker installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Vietnamese_Reranker install url in huggingface.co: