---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:33
- loss:MatryoshkaLoss
- loss:MultipleNegativesRankingLoss
base_model: keepitreal/vietnamese-sbert
widget:
- source_sentence: Áo Polo Lacoste với chất liệu Petit Piqué và thiết kế cổ gập kinh
điển
sentences:
- Giày cao gót đẳng cấp
- Xe điều khiển từ xa
- Áo polo sang trọng
- source_sentence: Sony Alpha A7 IV với cảm biến CMOS Exmor R 33MP và khả năng quay
4K 60fps
sentences:
- Giày cao gót sang trọng
- Sách văn học tuổi thơ
- Máy ảnh chuyên nghiệp
- source_sentence: Laneige Water Bank Cream với công nghệ Hydro Ionized Mineral Water
và kết cấu gel mỏng nhẹ
sentences:
- Điện thoại flagship cao cấp
- Kem dưỡng ẩm nổi bật
- Giày tây nam lịch lãm
- source_sentence: Adidas Ultraboost với công nghệ Boost™ và đế ngoài Continental™
Rubber
sentences:
- Tai nghe chống ồn hàng đầu
- Quần short kaki trẻ trung
- Giày chạy bộ hiện đại
- source_sentence: Áo thun từ cotton mềm mại, kiểu dáng đa dạng phù hợp cho nhiều
phong cách
sentences:
- Máy ảnh vlog chuyên nghiệp
- Áo thun thoải mái
- Laptop hiệu năng mạnh mẽ
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- cosine_accuracy@1
- cosine_accuracy@3
- cosine_accuracy@5
- cosine_accuracy@10
- cosine_precision@1
- cosine_precision@3
- cosine_precision@5
- cosine_precision@10
- cosine_recall@1
- cosine_recall@3
- cosine_recall@5
- cosine_recall@10
- cosine_ndcg@10
- cosine_mrr@10
- cosine_map@100
model-index:
- name: SentenceTransformer based on keepitreal/vietnamese-sbert
results:
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 768
type: dim_768
metrics:
- type: cosine_accuracy@1
value: 0.25
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.75
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.75
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 1.0
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.25
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.25
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.15000000000000002
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.1
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.25
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.75
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.75
name: Cosine Recall@5
- type: cosine_recall@10
value: 1.0
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.6377310833652008
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.525
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.525
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 512
type: dim_512
metrics:
- type: cosine_accuracy@1
value: 0.25
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.75
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.75
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 1.0
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.25
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.25
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.15000000000000002
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.1
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.25
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.75
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.75
name: Cosine Recall@5
- type: cosine_recall@10
value: 1.0
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.6079899373088598
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.4861111111111111
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.4861111111111111
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 256
type: dim_256
metrics:
- type: cosine_accuracy@1
value: 0.25
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.75
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.75
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.75
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.25
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.25
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.15000000000000002
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.07500000000000001
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.25
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.75
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.75
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.75
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.5
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.41666666666666663
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.43749999999999994
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 128
type: dim_128
metrics:
- type: cosine_accuracy@1
value: 0.5
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.75
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.75
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 1.0
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.5
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.25
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.15000000000000002
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.1
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.5
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.75
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.75
name: Cosine Recall@5
- type: cosine_recall@10
value: 1.0
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.7410657717261977
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.6607142857142857
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.6607142857142857
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 64
type: dim_64
metrics:
- type: cosine_accuracy@1
value: 0.0
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.5
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.5
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.75
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.0
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.16666666666666666
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.1
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.07500000000000001
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.0
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.5
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.5
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.75
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.4045166735627343
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.29166666666666663
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.30952380952380953
name: Cosine Map@100
---
# SentenceTransformer based on keepitreal/vietnamese-sbert
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [keepitreal/vietnamese-sbert](https://huggingface.co/keepitreal/vietnamese-sbert) on the json 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:** [keepitreal/vietnamese-sbert](https://huggingface.co/keepitreal/vietnamese-sbert)
- **Maximum Sequence Length:** 256 tokens
- **Output Dimensionality:** 768 dimensions
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
- json
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/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': 256, 'do_lower_case': False}) with Transformer model: RobertaModel
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)
```
## 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("zxcvo/product-search-model")
# Run inference
sentences = [
'Áo thun từ cotton mềm mại, kiểu dáng đa dạng phù hợp cho nhiều phong cách',
'Áo thun thoải mái',
'Laptop hiệu năng mạnh mẽ',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
```
## Evaluation
### Metrics
#### Information Retrieval
* Datasets: `dim_768`, `dim_512`, `dim_256`, `dim_128` and `dim_64`
* Evaluated with [InformationRetrievalEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
| Metric | dim_768 | dim_512 | dim_256 | dim_128 | dim_64 |
|:--------------------|:-----------|:----------|:--------|:-----------|:-----------|
| cosine_accuracy@1 | 0.25 | 0.25 | 0.25 | 0.5 | 0.0 |
| cosine_accuracy@3 | 0.75 | 0.75 | 0.75 | 0.75 | 0.5 |
| cosine_accuracy@5 | 0.75 | 0.75 | 0.75 | 0.75 | 0.5 |
| cosine_accuracy@10 | 1.0 | 1.0 | 0.75 | 1.0 | 0.75 |
| cosine_precision@1 | 0.25 | 0.25 | 0.25 | 0.5 | 0.0 |
| cosine_precision@3 | 0.25 | 0.25 | 0.25 | 0.25 | 0.1667 |
| cosine_precision@5 | 0.15 | 0.15 | 0.15 | 0.15 | 0.1 |
| cosine_precision@10 | 0.1 | 0.1 | 0.075 | 0.1 | 0.075 |
| cosine_recall@1 | 0.25 | 0.25 | 0.25 | 0.5 | 0.0 |
| cosine_recall@3 | 0.75 | 0.75 | 0.75 | 0.75 | 0.5 |
| cosine_recall@5 | 0.75 | 0.75 | 0.75 | 0.75 | 0.5 |
| cosine_recall@10 | 1.0 | 1.0 | 0.75 | 1.0 | 0.75 |
| **cosine_ndcg@10** | **0.6377** | **0.608** | **0.5** | **0.7411** | **0.4045** |
| cosine_mrr@10 | 0.525 | 0.4861 | 0.4167 | 0.6607 | 0.2917 |
| cosine_map@100 | 0.525 | 0.4861 | 0.4375 | 0.6607 | 0.3095 |
## Training Details
### Training Dataset
#### json
* Dataset: json
* Size: 33 training samples
* Columns: positive
and anchor
* Approximate statistics based on the first 33 samples:
| | positive | anchor |
|:--------|:-----------------------------------------------------------------------------------|:--------------------------------------------------------------------------------|
| type | string | string |
| details |
Áo Sơ Mi Nam Trắng Classic với chất liệu cotton cao cấp, kiểu dáng lịch lãm
| Áo sơ mi tinh tế
|
| Đắc Nhân Tâm của Dale Carnegie với những nguyên tắc xây dựng mối quan hệ hiệu quả
| Sách kinh điển về giao tiếp
|
| Nike Air Force 1 với thiết kế logo Swoosh và công nghệ Air-Sole
| Giày sneaker cổ điển
|
* Loss: [MatryoshkaLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
```json
{
"loss": "MultipleNegativesRankingLoss",
"matryoshka_dims": [
768,
512,
256,
128,
64
],
"matryoshka_weights": [
1,
1,
1,
1,
1
],
"n_dims_per_step": -1
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: epoch
- `per_device_train_batch_size`: 32
- `gradient_accumulation_steps`: 16
- `learning_rate`: 2e-05
- `num_train_epochs`: 4
- `bf16`: True
- `load_best_model_at_end`: True
#### All Hyperparameters