Downloads · 30 days
71
22% of all-time downloads
LakoreAI/mmbert-small-vn-sts-001
mmbert-small-vn-sts-001 is a sentence similarity model from LakoreAI. Use it when you need a score for how close two texts are. It is set up for sentence-transformers.
This is a sentence-transformers model finetuned from jhu-clsp/mmBERT-small. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, para…
Downloads · 30 days
71
22% of all-time downloads
All-time downloads
323
Public
Parameters
140M
596 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors562 MB · 94%
From the Hugging Face model README
This is a sentence-transformers model finetuned from jhu-clsp/mmBERT-small. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
SentenceTransformer(
(0): Transformer({'max_seq_length': 8192, 'do_lower_case': False, 'architecture': 'ModernBertModel'})
(1): Pooling({'word_embedding_dimension': 384, '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})
)
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("8Opt/mmbert-small-vn-sts-001")
# Run inference
sentences = [
'Một người đàn ông đang ngồi gần một chiếc xe đạp và đang viết một ghi chú',
'Một người đàn ông mặc quần áo được phủ sơn và đang ngồi bên ngoài trong một khu vực đông đúc để viết một cái gì đó',
'Các vận động viên khuyết tật chuẩn bị sẵn sàng, làm dấy lên những câu hỏi về hậu cần và sự công bằng.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.9369, 0.9048],
# [0.9369, 1.0000, 0.8964],
# [0.9048, 0.8964, 1.0000]])
<!--
### Direct Usage (Transformers)
<details><summary>Click to see the direct usage in Transformers</summary>
</details>
-->
<!--
### Downstream Usage (Sentence Transformers)
You can finetune this model on your own dataset.
<details><summary>Click to expand</summary>
</details>
-->
<!--
### Out-of-Scope Use
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->
8Opt-sts-dev-0002 and 8Opt-sts-test-0002| Metric | 8Opt-sts-dev-0002 | 8Opt-sts-test-0002 |
|---|---|---|
| pearson_cosine | 0.693 | 0.693 |
| spearman_cosine | 0.7196 | 0.7196 |
| sentence1 | sentence2 | score | |
|---|---|---|---|
| type | string | string | float |
| details | <ul><li>min: 6 tokens</li><li>mean: 18.02 tokens</li><li>max: 74 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 17.77 tokens</li><li>max: 81 tokens</li></ul> | <ul><li>min: 0.04</li><li>mean: 2.6</li><li>max: 5.0</li></ul> |
| sentence1 | sentence2 | score |
|---|---|---|
| <code>Một con chó đen đang chạy trong tuyết.</code> | <code>Một con chó đen đang chạy trên bãi biển.</code> | <code>1.8</code> |
| <code>bóng đèn a tạo ra một khoảng trống</code> | <code>nếu bóng đèn a cháy ra, cả b và c đều không ở trong một đường kín</code> | <code>1.8</code> |
| <code>Sự phát triển an ninh tại Iraq, ngày 1 tháng 2</code> | <code>Sự phát triển an ninh tại Pakistan, ngày 13 tháng 3</code> | <code>1.6</code> |
{
"scale": 20.0,
"similarity_fct": "pairwise_cos_sim"
}
| sentence1 | sentence2 | score | |
|---|---|---|---|
| type | string | string | float |
| details | <ul><li>min: 3 tokens</li><li>mean: 18.71 tokens</li><li>max: 107 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 17.54 tokens</li><li>max: 91 tokens</li></ul> | <ul><li>min: 0.04</li><li>mean: 2.56</li><li>max: 5.0</li></ul> |
| sentence1 | sentence2 | score |
|---|---|---|
| <code>một đơn vị đáp ứng các điều kiện tiên quyết để tham gia vào một sự kiện. một mức độ sửa đổi có thể được bao gồm để chỉ ra bao nhiêu đơn vị vượt quá hoặc không đạt được các yêu cầu tối thiểu.</code> | <code>(thường theo sau là `to ') có phương tiện cần thiết hoặc kỹ năng hoặc bí quyết hoặc thẩm quyền để làm một cái gì đó;</code> | <code>0.4</code> |
| <code>Tôi sẽ không đưa nó vào hồ sơ của mình.</code> | <code>Tôi sẽ không đưa công việc này vào hồ sơ của mình.</code> | <code>4.0</code> |
| <code>Một cậu bé trẻ với một chiếc áo khoác chứa tim đang nâng tay lên khi anh ta trượt</code> | <code>Một đứa trẻ tóc vàng đang đi xuống một slide và ném lên tay của mình</code> | <code>3.7</code> |
{
"scale": 20.0,
"similarity_fct": "pairwise_cos_sim"
}
eval_strategy: stepsper_device_train_batch_size: 45per_device_eval_batch_size: 45learning_rate: 2e-05warmup_ratio: 0.1fp16: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 45per_device_eval_batch_size: 45per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_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: 3max_steps: -1lr_scheduler_type: linearlr_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: Falsebf16: Falsefp16: Truefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Falseignore_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}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthproject: huggingfacetrackio_space_id: trackioddp_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: noneftune_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: Trueprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | Validation Loss | 8Opt-sts-dev-0002_spearman_cosine | 8Opt-sts-test-0002_spearman_cosine |
|---|---|---|---|---|---|
| 0.1550 | 100 | 6.8187 | 6.7929 | 0.5004 | - |
| 0.3101 | 200 | 6.7419 | 6.7168 | 0.6143 | - |
| 0.4651 | 300 | 6.6975 | 6.7319 | 0.6434 | - |
| 0.6202 | 400 | 6.6737 | 6.6706 | 0.6739 | - |
| 0.7752 | 500 | 6.6784 | 6.7054 | 0.6772 | - |
| 0.9302 | 600 | 6.6712 | 6.6551 | 0.6898 | - |
| 1.0853 | 700 | 6.5671 | 6.6602 | 0.6959 | - |
| 1.2403 | 800 | 6.5571 | 6.6496 | 0.6945 | - |
| 1.3953 | 900 | 6.5368 | 6.6535 | 0.7046 | - |
| 1.5504 | 1000 | 6.5372 | 6.6903 | 0.7055 | - |
| 1.7054 | 1100 | 6.5123 | 6.6377 | 0.7162 | - |
| 1.8605 | 1200 | 6.5288 | 6.6298 | 0.7181 | - |
| 2.0155 | 1300 | 6.4976 | 6.6644 | 0.7204 | - |
| 2.1705 | 1400 | 6.3824 | 6.7222 | 0.7172 | - |
| 2.3256 | 1500 | 6.3512 | 6.7714 | 0.7165 | - |
| 2.4806 | 1600 | 6.3392 | 6.7757 | 0.7161 | - |
| 2.6357 | 1700 | 6.3487 | 6.7514 | 0.7205 | - |
| 2.7907 | 1800 | 6.3476 | 6.7294 | 0.7195 | - |
| 2.9457 | 1900 | 6.3519 | 6.7533 | 0.7196 | - |
| -1 | -1 | - | - | - | 0.7196 |
@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",
}
@article{10531646,
author={Huang, Xiang and Peng, Hao and Zou, Dongcheng and Liu, Zhiwei and Li, Jianxin and Liu, Kay and Wu, Jia and Su, Jianlin and Yu, Philip S.},
journal={IEEE/ACM Transactions on Audio, Speech, and Language Processing},
title={CoSENT: Consistent Sentence Embedding via Similarity Ranking},
year={2024},
doi={10.1109/TASLP.2024.3402087}
}
<!--
## Glossary
*Clearly define terms in order to be accessible across audiences.*
-->
<!--
## Model Card Authors
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->
<!--
## Model Card Contact
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
-->