SentenceTransformer based on dangvantuan/vietnamese-document-embedding
This is a sentence-transformers model finetuned from dangvantuan/vietnamese-document-embedding. 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
- Maximum Sequence Length: 8192 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
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:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("HoangVuSnape/vietnamese-document-embedding_pr_v3")
# Run inference
sentences = [
'Chương trình đào tạo của Đại học FPT có những điểm nổi bật nào?',
'Học phí: 11,900,000 VNĐ/mức. 3. Các khoản phí cần nộp khi nhập học\n\nHọc phí kỳ định hướng: 11,900,000 VNĐ (có 01 học kỳ định hướng, chỉ áp dụng cho SV mới nhập học năm 2024)\n\nHọc phí 01 mức tiếng Anh chuẩn bị: 11,900,000 VNĐ/mức\n\n1. Giáo trình chuẩn quốc tế\n\nChương trình học của Đại học FPT được thiết kế theo chuẩn của Hiệp hội Máy tính (Association for Computing Machinery-ACM), chuẩn đào tạo kỹ sư phần mềm của Accreditation Board for Engineering and Technology (ABET – Mỹ), Hiệp hội Phần mềm Việt Nam (VINASA)\n\nTất cả các giáo trình của Đại học FPT đều được nhập khẩu từ nước ngoài về và cập nhật liên tục theo từng kỳ học\n\n2. Chú trọng vào thực hành\n\nVới thời lượng số tiết thực hành lên đến 60%, sinh viên Đại học FPT đã được làm quen với công việc ngay từ trên ghế nhà trường. 1 lớp học tối đa 30 sinh viên nên trong các giờ thực hành sinh viên sẽ được các thầy cô giảng viên hướng dẫn rất tỉ mỉ và chi tiết\n\n3. Chú trọng vào ngoại ngữ và kỹ năng mềm\n\nNăm đầu tiên các bạn sinh viên sẽ phải trải qua 6 kỳ học tiếng Anh để có thể đạt được nền tảng ngoại ngữ nhất định trước khi sang năm thứ 2 bước vào kỳ học chuyên ngành. Ngoài tiếng Anh là ngôn ngữ bắt buộc ra thì sinh viên Đại học FPT còn được học thêm tiếng Nhật. Như vậy sau khi ra trường các bạn sinh viên có thêm rất nhiều cơ hội để có thể làm việc tại nước ngoài\n\nNgay từ những ngày đầu thành lập, đại học FPT đã đề cao việc phát triển bản thân đặc biệt là kỹ năng mềm cho sinh viên. Các bạn sinh viên sẽ được học rất nhiều các khoá học như kỹ năng thuyết trình, tư duy phản biện, kỹ năng làm việc nhóm, kỹ năng phỏng vấn, kỹ năng viết CV .',
'STT Mã ngành Tên ngành Tổ hợp môn Điểm chuẩn Ghi chú 1 7220201 Ngôn ngữ Anh A; B; C01; C02; C03; C04 21 2 7220204 Ngôn ngữ Trung Quốc A; B; C01; C02; C03; C04 21 3 7220209 Ngôn ngữ Nhật A; B; C01; C02; C03; C04 21 4 7220210 Ngôn ngữ Hàn Quốc A; B; C01; C02; C03; C04 21 5 7320106 Công nghệ truyền thông A; B; C01; C02; C03; C04 21 6 7340101 Quản trị kinh doanh A; B; C01; C02; C03; C04 21 7 7480201 Công nghệ thông tin A; B; C01; C02; C03; C04 21 Phương thức xét tuyển của fpt khá giống nhau.',
]
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.7188, 0.5351],
# [0.7188, 1.0000, 0.5165],
# [0.5351, 0.5165, 1.0000]])
Evaluation
Metrics
Information Retrieval
- Dataset:
dim_768
- Evaluated with
InformationRetrievalEvaluator
with these parameters:{ "truncate_dim": 768 }
Metric | Value |
---|---|
cosine_accuracy@1 | 0.466 |
cosine_accuracy@3 | 0.63 |
cosine_accuracy@5 | 0.678 |
cosine_accuracy@10 | 0.752 |
cosine_precision@1 | 0.466 |
cosine_precision@3 | 0.21 |
cosine_precision@5 | 0.1356 |
cosine_precision@10 | 0.0752 |
cosine_recall@1 | 0.466 |
cosine_recall@3 | 0.63 |
cosine_recall@5 | 0.678 |
cosine_recall@10 | 0.752 |
cosine_ndcg@10 | 0.6061 |
cosine_mrr@10 | 0.5599 |
cosine_map@100 | 0.5686 |
Information Retrieval
- Dataset:
dim_512
- Evaluated with
InformationRetrievalEvaluator
with these parameters:{ "truncate_dim": 512 }
Metric | Value |
---|---|
cosine_accuracy@1 | 0.464 |
cosine_accuracy@3 | 0.626 |
cosine_accuracy@5 | 0.684 |
cosine_accuracy@10 | 0.746 |
cosine_precision@1 | 0.464 |
cosine_precision@3 | 0.2087 |
cosine_precision@5 | 0.1368 |
cosine_precision@10 | 0.0746 |
cosine_recall@1 | 0.464 |
cosine_recall@3 | 0.626 |
cosine_recall@5 | 0.684 |
cosine_recall@10 | 0.746 |
cosine_ndcg@10 | 0.6015 |
cosine_mrr@10 | 0.5556 |
cosine_map@100 | 0.5648 |
Information Retrieval
- Dataset:
dim_256
- Evaluated with
InformationRetrievalEvaluator
with these parameters:{ "truncate_dim": 256 }
Metric | Value |
---|---|
cosine_accuracy@1 | 0.452 |
cosine_accuracy@3 | 0.602 |
cosine_accuracy@5 | 0.672 |
cosine_accuracy@10 | 0.732 |
cosine_precision@1 | 0.452 |
cosine_precision@3 | 0.2007 |
cosine_precision@5 | 0.1344 |
cosine_precision@10 | 0.0732 |
cosine_recall@1 | 0.452 |
cosine_recall@3 | 0.602 |
cosine_recall@5 | 0.672 |
cosine_recall@10 | 0.732 |
cosine_ndcg@10 | 0.5884 |
cosine_mrr@10 | 0.5428 |
cosine_map@100 | 0.5525 |
Training Details
Training Dataset
Unnamed Dataset
- Size: 500 training samples
- Columns:
anchor
andpositive
- Approximate statistics based on the first 500 samples:
anchor positive type string string details - min: 10 tokens
- mean: 26.05 tokens
- max: 62 tokens
- min: 29 tokens
- mean: 605.11 tokens
- max: 6602 tokens
- Samples:
anchor positive Ngành Quản lý Tài nguyên và Môi trường trang bị cho sinh viên những kiến thức và kỹ năng gì?
Sau khi tốt nghiệp, người học sẽ:
Có kiến thức cơ bản về toán học, khoa học tự nhiên, đáp ứng cho việc tiếp thu các kiến thức giáo dục chuyên nghiệp và khả năng học tập ở trình độ cao hơn
Có các kiến thức kỹ thuật cơ sở ngành và chuyên ngành giúp đủ năng lực phát hiện, giải quyết các vấn đề liên quan đến công nghệ sản xuất, chế tạo và ứng dụng vật liệu vào trong xây dựng, kiểm soát chất lượng nguyên vật liệu và cấu kiện sản phẩm xây dựng, nghiên cứu sản xuất chế tạo và phát triển các loại vật liệu mới, hiện đại, tiên tiến, độc đáo, hiệu quả, xanh, bền vững… nhằm hướng tới sự phát triển bền vững trong công nghiệp xây dựng và kiến trúc, thiết kế và thi công trong các công trình xây dựng; có tính sáng tạo trong hoạt động nghề nghiệp, có khả năng tự học và tự nghiên cứu;
Có kỹ năng cá nhân, nghề nghiệp, giao tiếp, làm việc nhóm đủ để làm việc trong môi trường làm việc liên ngành, đa văn hóa;
Có hiểu biết về kinh tế, chính trị, có các kiến thức cơ bản trong lĩnh vực khoa học xã hội và n...Chương trình Kỹ thuật Môi trường đào tạo sinh viên về những năng lực nào và có điểm gì nổi bật đối với chương trình giảng dạy bằng tiếng Anh?
Sau khi tốt nghiệp, người học sẽ:
Có kiến thức cơ bản về toán học, khoa học tự nhiên, đáp ứng cho việc tiếp thu các kiến thức giáo dục chuyên nghiệp và khả năng học tập ở trình độ cao hơn
Có các kiến thức kỹ thuật cơ sở ngành và chuyên ngành giúp đủ năng lực phát hiện, giải quyết các vấn đề liên quan đến công nghệ sản xuất, chế tạo và ứng dụng vật liệu vào trong xây dựng, kiểm soát chất lượng nguyên vật liệu và cấu kiện sản phẩm xây dựng, nghiên cứu sản xuất chế tạo và phát triển các loại vật liệu mới, hiện đại, tiên tiến, độc đáo, hiệu quả, xanh, bền vững… nhằm hướng tới sự phát triển bền vững trong công nghiệp xây dựng và kiến trúc, thiết kế và thi công trong các công trình xây dựng; có tính sáng tạo trong hoạt động nghề nghiệp, có khả năng tự học và tự nghiên cứu;
Có kỹ năng cá nhân, nghề nghiệp, giao tiếp, làm việc nhóm đủ để làm việc trong môi trường làm việc liên ngành, đa văn hóa;
Có hiểu biết về kinh tế, chính trị, có các kiến thức cơ bản trong lĩnh vực khoa học xã hội và n...Ngành Kỹ thuật Dầu khí và Kỹ thuật Địa chất tập trung nghiên cứu và ứng dụng những lĩnh vực cốt lõi nào?
Các công ty nghiên cứu và khảo sát địa chất, tư vấn về nền móng công trình. Các tổ chức liên quan đến quy hoạch và phát triển đô thị. Kỹ thuật Dầu khí
Tổng quan
Kỹ thuật Dầu khí là ngành học chuyên nghiên cứu về các kỹ thuật khai thác, sản xuất và xử lý dầu khí. Sinh viên sẽ học các phương pháp khoan, khai thác dầu, khí tự nhiên, và xử lý các vấn đề kỹ thuật trong ngành dầu khí, từ việc tìm kiếm và khai thác tài nguyên cho đến việc tối ưu hóa quy trình sản xuất. CÁC ĐIỂM ĐẶC BIỆT
Khả năng ứng dụng cao: Sinh viên ngành Kỹ thuật Dầu khí sẽ được trang bị kiến thức thực tế về công nghệ khai thác dầu khí và các phương pháp tối ưu hóa sản xuất. Ngành công nghiệp chiến lược: Dầu khí vẫn là một trong những ngành công nghiệp mũi nhọn và cần nguồn nhân lực có trình độ cao trong việc khai thác và xử lý tài nguyên thiên nhiên. Triển vọng việc làm
Các công ty khai thác dầu khí trong nước và quốc tế. Các công ty tư vấn và kỹ thuật dầu khí, nghiên cứu các giải pháp tối ưu trong khai thác. Các côn... - Loss:
MatryoshkaLoss
with these parameters:{ "loss": "MultipleNegativesRankingLoss", "matryoshka_dims": [ 768, 512, 256 ], "matryoshka_weights": [ 1, 1, 1 ], "n_dims_per_step": -1 }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 16per_device_eval_batch_size
: 16gradient_accumulation_steps
: 8learning_rate
: 2e-05num_train_epochs
: 1lr_scheduler_type
: cosinewarmup_ratio
: 0.1bf16
: Truetf32
: Truedataloader_drop_last
: Truedataloader_num_workers
: 8load_best_model_at_end
: Truebatch_sampler
: no_duplicates
All Hyperparameters
Click to expand
overwrite_output_dir
: Falsedo_predict
: Falseeval_strategy
: stepsprediction_loss_only
: Trueper_device_train_batch_size
: 16per_device_eval_batch_size
: 16per_gpu_train_batch_size
: Noneper_gpu_eval_batch_size
: Nonegradient_accumulation_steps
: 8eval_accumulation_steps
: Nonetorch_empty_cache_steps
: Nonelearning_rate
: 2e-05weight_decay
: 0.0adam_beta1
: 0.9adam_beta2
: 0.999adam_epsilon
: 1e-08max_grad_norm
: 1.0num_train_epochs
: 1max_steps
: -1lr_scheduler_type
: cosinelr_scheduler_kwargs
: {}warmup_ratio
: 0.1warmup_steps
: 0log_level
: passivelog_level_replica
: warninglog_on_each_node
: Truelogging_nan_inf_filter
: Truesave_safetensors
: Truesave_on_each_node
: Falsesave_only_model
: Falserestore_callback_states_from_checkpoint
: Falseno_cuda
: Falseuse_cpu
: Falseuse_mps_device
: Falseseed
: 42data_seed
: Nonejit_mode_eval
: Falseuse_ipex
: Falsebf16
: Truefp16
: Falsefp16_opt_level
: O1half_precision_backend
: autobf16_full_eval
: Falsefp16_full_eval
: Falsetf32
: Truelocal_rank
: 0ddp_backend
: Nonetpu_num_cores
: Nonetpu_metrics_debug
: Falsedebug
: []dataloader_drop_last
: Truedataloader_num_workers
: 8dataloader_prefetch_factor
: Nonepast_index
: -1disable_tqdm
: Falseremove_unused_columns
: Truelabel_names
: Noneload_best_model_at_end
: Trueignore_data_skip
: Falsefsdp
: []fsdp_min_num_params
: 0fsdp_config
: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap
: Noneaccelerator_config
: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed
: Nonelabel_smoothing_factor
: 0.0optim
: adamw_torch_fusedoptim_args
: Noneadafactor
: Falsegroup_by_length
: Falselength_column_name
: lengthddp_find_unused_parameters
: Noneddp_bucket_cap_mb
: Noneddp_broadcast_buffers
: Falsedataloader_pin_memory
: Truedataloader_persistent_workers
: Falseskip_memory_metrics
: Trueuse_legacy_prediction_loop
: Falsepush_to_hub
: Falseresume_from_checkpoint
: Nonehub_model_id
: Nonehub_strategy
: every_savehub_private_repo
: Nonehub_always_push
: Falsehub_revision
: Nonegradient_checkpointing
: Falsegradient_checkpointing_kwargs
: Noneinclude_inputs_for_metrics
: Falseinclude_for_metrics
: []eval_do_concat_batches
: Truefp16_backend
: autopush_to_hub_model_id
: Nonepush_to_hub_organization
: Nonemp_parameters
:auto_find_batch_size
: Falsefull_determinism
: Falsetorchdynamo
: Noneray_scope
: lastddp_timeout
: 1800torch_compile
: Falsetorch_compile_backend
: Nonetorch_compile_mode
: Noneinclude_tokens_per_second
: Falseinclude_num_input_tokens_seen
: Falseneftune_noise_alpha
: Noneoptim_target_modules
: Nonebatch_eval_metrics
: Falseeval_on_start
: Falseuse_liger_kernel
: Falseliger_kernel_config
: Noneeval_use_gather_object
: Falseaverage_tokens_across_devices
: Falseprompts
: Nonebatch_sampler
: no_duplicatesmulti_dataset_batch_sampler
: proportionalrouter_mapping
: {}learning_rate_mapping
: {}
Training Logs
Epoch | Step | dim_768_cosine_ndcg@10 | dim_512_cosine_ndcg@10 | dim_256_cosine_ndcg@10 |
---|---|---|---|---|
-1 | -1 | 0.6061 | 0.6015 | 0.5884 |
Framework Versions
- Python: 3.10.12
- Sentence Transformers: 5.1.0
- Transformers: 4.55.2
- PyTorch: 2.8.0+cu128
- Accelerate: 1.10.0
- Datasets: 4.0.0
- Tokenizers: 0.21.4
Citation
BibTeX
Sentence Transformers
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
MatryoshkaLoss
@misc{kusupati2024matryoshka,
title={Matryoshka Representation Learning},
author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
year={2024},
eprint={2205.13147},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
MultipleNegativesRankingLoss
@misc{henderson2017efficient,
title={Efficient Natural Language Response Suggestion for Smart Reply},
author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
year={2017},
eprint={1705.00652},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
- Downloads last month
- 2
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support
Model tree for HoangVuSnape/vietnamese-document-embedding_pr_v3
Base model
dangvantuan/vietnamese-document-embeddingEvaluation results
- Cosine Accuracy@1 on dim 768self-reported0.466
- Cosine Accuracy@3 on dim 768self-reported0.630
- Cosine Accuracy@5 on dim 768self-reported0.678
- Cosine Accuracy@10 on dim 768self-reported0.752
- Cosine Precision@1 on dim 768self-reported0.466
- Cosine Precision@3 on dim 768self-reported0.210
- Cosine Precision@5 on dim 768self-reported0.136
- Cosine Precision@10 on dim 768self-reported0.075
- Cosine Recall@1 on dim 768self-reported0.466
- Cosine Recall@3 on dim 768self-reported0.630