---
language:
- vi
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dense
- generated_from_trainer
- dataset_size:81409
- loss:TripletLoss
base_model: dangvantuan/vietnamese-document-embedding
widget:
- source_sentence: Đâu là lập luận tồi tệ nhất trên thế giới?
sentences:
- Một số ví dụ về phương tiện giao thông cũ và hiện đại là gì?
- Trận chiến nào trong lịch sử thế giới là tồi tệ nhất?
- Cuộc tranh luận tồi tệ nhất trên thế giới là gì?
- source_sentence: Nghị quyết năm mới 2017 của bạn là gì?
sentences:
- Bạn có nghĩ việc các thẩm phán luôn thực thi nguyên tắc loại trừ là quan trọng
hơn không?
- Quyết tâm của bạn cho năm 2017 là gì?
- Quyết tâm năm mới 2016 của bạn là gì?
- source_sentence: Làm thế nào để tôi vượt qua cuộc kiểm tra ma túy đá?
sentences:
- Bạn muốn Donald Trump hay Hillary Clinton trở thành TIỀM NĂNG?
- Tập thể dục có giúp vượt qua bài kiểm tra ma túy đá không?
- Liệu 0,2 gam meth có xuất hiện trong xét nghiệm nước tiểu 99 giờ sau khi tiêu
thụ không?
- source_sentence: Loạt phim về Người ngoài hành tinh cổ đại trên Kênh Lịch sử có
độ chính xác như thế nào?
sentences:
- Bạn nghĩ gì về loạt phim Người ngoài hành tinh cổ đại?
- Nếu Bắc Ireland, xứ Wales hoặc Scotland rời khỏi Vương quốc Anh, liệu lá cờ của
Vương quốc Anh có được giữ nguyên hay trở lại phiên bản trước đó?
- Người ngoài hành tinh cổ đại được chiếu trên Kênh Lịch sử có thật đến mức nào?
- source_sentence: Antivirus có phục hồi được các tập tin đã xóa không?
sentences:
- Cảm giác là con trai/con gái của cha mẹ đồng tính như thế nào?
- Làm cách nào để khôi phục các tập tin bị xóa vĩnh viễn?
- Làm thế nào phần mềm chống vi-rút phục hồi các tập tin đã xóa?
datasets:
- NghiemAbe/QQP_triplet
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- cosine_accuracy
model-index:
- name: SentenceTransformer based on dangvantuan/vietnamese-document-embedding
results:
- task:
type: triplet
name: Triplet
dataset:
name: Unknown
type: unknown
metrics:
- type: cosine_accuracy
value: 0.6684518456459045
name: Cosine Accuracy
---
# SentenceTransformer based on dangvantuan/vietnamese-document-embedding
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [dangvantuan/vietnamese-document-embedding](https://huggingface.co/dangvantuan/vietnamese-document-embedding) on the [qqp_triplet](https://huggingface.co/datasets/NghiemAbe/QQP_triplet) dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
## Model Details
### Model Description
- **Model Type:** Sentence Transformer
- **Base model:** [dangvantuan/vietnamese-document-embedding](https://huggingface.co/dangvantuan/vietnamese-document-embedding)
- **Maximum Sequence Length:** 8192 tokens
- **Output Dimensionality:** 768 dimensions
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
- [qqp_triplet](https://huggingface.co/datasets/NghiemAbe/QQP_triplet)
- **Language:** vi
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
### Full Model Architecture
```
SentenceTransformer(
(0): Transformer({'max_seq_length': 8192, 'do_lower_case': False, 'architecture': 'VietnameseModel'})
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
(2): Normalize()
)
```
## Usage
### Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
```bash
pip install -U sentence-transformers
```
Then you can load this model and run inference.
```python
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("KietRiu/vietnamese-document-embedding_FT_QQP")
# Run inference
sentences = [
'Antivirus có phục hồi được các tập tin đã xóa không?',
'Làm thế nào phần mềm chống vi-rút phục hồi các tập tin đã xóa?',
'Làm cách nào để khôi phục các tập tin bị xóa vĩnh viễn?',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.9915, 0.7706],
# [0.9915, 1.0000, 0.8112],
# [0.7706, 0.8112, 1.0000]])
```
## Evaluation
### Metrics
#### Triplet
* Evaluated with [TripletEvaluator](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.TripletEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| **cosine_accuracy** | **0.6685** |
## Training Details
### Training Dataset
#### qqp_triplet
* Dataset: [qqp_triplet](https://huggingface.co/datasets/NghiemAbe/QQP_triplet) at [a48ebfe](https://huggingface.co/datasets/NghiemAbe/QQP_triplet/tree/a48ebfea42995330c3ce7eb69f8786635d1a6494)
* Size: 81,409 training samples
* Columns: anchor, positive, and negative
* Approximate statistics based on the first 1000 samples:
| | anchor | positive | negative |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string | string |
| details |
Donald Trump mong đợi Mexico trả tiền cho bức tường biên giới do ông đề xuất như thế nào? | Làm thế nào Donald Trump có thể khiến Mexico trả tiền cho bức tường biên giới? | Điều gì sẽ xảy ra nếu bức tường của Trump hoàn toàn không phải là bức tường vật lý? Ông ấy nói Mexico sẽ trả tiền. Một số biện pháp ngăn chặn tài chính mà Mỹ có thể áp đặt là gì? Có thể được không? |
| Sự khác biệt giữa thực phẩm Trung Quốc và thực phẩm phương Tây là gì? | Sự khác biệt giữa thực phẩm phương Tây và Trung Quốc là gì? | Sự khác biệt giữa thực phẩm Trung Quốc và thực phẩm Nhật Bản là gì? |
| Làm cách nào tôi có thể đặt câu hỏi cho một người cụ thể trên Quora ngoài những câu hỏi được đề xuất? | Tôi muốn đặt câu hỏi cho một người cụ thể trên Quora, tôi phải làm gì? | Câu hỏi nào bạn có thể hỏi ai đó sẽ khơi dậy cuộc trò chuyện sâu sắc và thú vị? |
* Loss: [TripletLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#tripletloss) with these parameters:
```json
{
"distance_metric": "TripletDistanceMetric.EUCLIDEAN",
"triplet_margin": 0.7
}
```
### Evaluation Dataset
#### qqp_triplet
* Dataset: [qqp_triplet](https://huggingface.co/datasets/NghiemAbe/QQP_triplet) at [a48ebfe](https://huggingface.co/datasets/NghiemAbe/QQP_triplet/tree/a48ebfea42995330c3ce7eb69f8786635d1a6494)
* Size: 20,353 evaluation samples
* Columns: anchor, positive, and negative
* Approximate statistics based on the first 1000 samples:
| | anchor | positive | negative |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string | string |
| details | Có trang web nào khác tương tự như Quora không? | Trang web tương tự như Quora là gì? | Quora có phải là một công cụ tìm kiếm (hơn một số loại trang web khác) không? |
| Hanuman Chalisa có thực sự hiệu quả hay chỉ đơn thuần là một hệ thống niềm tin? | Việc đọc và nói Hanuman Chalisa đối với tất cả những người theo đạo Hindu có hiệu quả đến mức nào? | Tại sao chúng ta nên đọc Hanuman chalisa? Kết quả của nó là gì? |
| Mục đích thực sự của cuộc sống là gì? | Mục đích cuộc sống của bạn nên là gì? | Chúng ta có thực sự có mục đích nào đó trong cuộc sống không? Hay chúng ta tạo ra một mục đích để khiến bản thân cảm thấy mình có ý nghĩa trong thế giới vô cùng rộng lớn, hay để khiến bản thân cảm thấy rằng sự tồn tại của chúng ta trong thế giới rộng lớn là cần thiết? |
* Loss: [TripletLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#tripletloss) with these parameters:
```json
{
"distance_metric": "TripletDistanceMetric.EUCLIDEAN",
"triplet_margin": 0.7
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 64
- `per_device_eval_batch_size`: 64
- `eval_accumulation_steps`: 1
- `learning_rate`: 2e-05
- `warmup_ratio`: 0.1
- `bf16`: True
- `load_best_model_at_end`: True
- `optim`: adamw_8bit
- `push_to_hub`: True
- `hub_model_id`: KietRiu/vietnamese-document-embedding_FT_QQP
- `batch_sampler`: no_duplicates
#### All Hyperparameters