CoolFace
Modelpublic

meandyou200175/E5_v5_3_5_instruct_topic

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes19downloads
Model Card

SentenceTransformer based on meandyou200175/E5v3instruct_topic

This is a sentence-transformers model finetuned from meandyou200175/E5_v3_instruct_topic. It maps sentences & paragraphs to a 1024-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: meandyou200175/E5_v3_instruct_topic <!-- at revision e1cd18d29dcab90869d10fb264523bc44cbe8455 -->
  • —Maximum Sequence Length: 512 tokens
  • —Output Dimensionality: 1024 dimensions
  • —Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'XLMRobertaModel'})
  (1): Pooling({'word_embedding_dimension': 1024, '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})
  (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("meandyou200175/E5_v5_3_5_instruct_topic")
# Run inference
sentences = [
    'task: sentence similarity | query: Vì đây không phải là thư viện công cộng nên Timrod phụ thuộc vào phí, lệ phí, quà tặng, di sản, đài tưởng niệm và lòng hảo tâm của bạn bè để có kinh phí duy trì và mở rộng bộ sưu tập cũng như bảo tồn tòa nhà lịch sử của nó.',
    'Nguồn tài trợ cho thư viện tư nhân Timrod.',
    '"Thánh thót tầu tiêu mấy giọt mưa, Bút thần khôn vẽ cảnh tiêu sơ."',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.8760, 0.0938],
#         [0.8760, 1.0000, 0.0996],
#         [0.0938, 0.0996, 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. -->

Evaluation

Metrics

Information Retrieval
MetricValue
cosine_accuracy@10.3147
cosine_accuracy@20.4001
cosine_accuracy@50.569
cosine_accuracy@100.6991
cosine_accuracy@1000.9908
cosine_precision@10.3147
cosine_precision@20.2001
cosine_precision@50.1138
cosine_precision@100.0699
cosine_precision@1000.0099
cosine_recall@10.3147
cosine_recall@20.4001
cosine_recall@50.569
cosine_recall@100.6991
cosine_recall@1000.9908
cosine_ndcg@100.486
cosine_mrr@10.3147
cosine_mrr@20.3574
cosine_mrr@50.4029
cosine_mrr@100.4203
cosine_mrr@1000.4348
cosine_map@1000.4348

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Dataset

Unnamed Dataset
  • —Size: 150,635 training samples
  • —Columns: <code>anchor</code> and <code>positive</code>
  • —Approximate statistics based on the first 1000 samples: | | anchor | positive | |:--------|:-------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 13 tokens</li><li>mean: 113.25 tokens</li><li>max: 299 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 10.91 tokens</li><li>max: 36 tokens</li></ul> |
  • —Samples: | anchor | positive | |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------| | <code>task: sentence similarity \| query: tiếng thốt ra biểu thị sự lo lắng, sửng sốt</code> | <code>chết, sao lại làm thế!</code> | | <code>task: sentence similarity \| query: Garnacha Tinta được chọn từ các vườn nho nằm ở Rioja Alta, đặc biệt là Cenicero và Nájera, với độ cao tương ứng là 650m và 500m, để đạt được sự tinh tế, tươi mát, đồng thời, có cấu trúc tốt.</code> | <code>Vườn nho Garnacha Tinta ở Rioja Alta</code> | | <code>task: sentence similarity \| query: có lòng thành thật, đầy nhiệt tình</code> | <code>sự giúp đỡ chân tình</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim",
      "gather_across_devices": false
  }

Evaluation Dataset

Unnamed Dataset
  • —Size: 1,522 evaluation samples
  • —Columns: <code>anchor</code> and <code>positive</code>
  • —Approximate statistics based on the first 1000 samples: | | anchor | positive | |:--------|:------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 12 tokens</li><li>mean: 112.8 tokens</li><li>max: 290 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 10.95 tokens</li><li>max: 32 tokens</li></ul> |
  • —Samples: | anchor | positive | |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------| | <code>task: sentence similarity \| query: nghiêm cấm bằng mệnh lệnh quân sự về việc đi lại, tụ họp, v.v. trong những khu vực và thời gian nhất định</code> | <code>lệnh giới nghiêm</code> | | <code>task: classification \| query: Cựu Tổng thống Donald Trump hôm thứ Năm cho biết rằng "rất khó có khả năng" ông sẽ ân xá cho mình nếu giành được một nhiệm kỳ khác vào năm 2024, đồng thời nói thêm trong một cuộc phỏng vấn độc quyền với người điều hành chương trình "Meet the Press" của NBC, Kristen Welker, rằng ông tin rằng mình không làm gì sai. "Tôi nghĩ điều đó rất khó xảy ra. Tôi đã làm gì sai? Tôi không làm gì sai cả", Trump nói. "Ý bạn là vì tôi phản đối một cuộc bầu cử nên họ muốn tống tôi vào tù?" Cuộc phỏng vấn đầu tiên của Welker với tư cách là người điều hành chương trình “Gặp gỡ báo chí” sẽ phát sóng vào Chủ nhật trên các chi nhánh của NBC trên toàn quốc. NBC News cũng đã gửi lời mời tới Tổng thống Joe Biden để ngồi lại phỏng vấn với Welker. Hãy theo dõi “Gặp gỡ báo chí với Kristen Welker” vào Chủ nhật tuần này để biết thêm thông </code> | <code>Tham nhũng chính trị Hoa Kỳ</code> | | <code>task: sentence similarity \| query: lan ra, toả rộng ra khắp xung quanh</code> | <code>hương thơm lan toả</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim",
      "gather_across_devices": false
  }

Training Hyperparameters

Non-Default Hyperparameters
  • —eval_strategy: steps
  • —per_device_train_batch_size: 32
  • —per_device_eval_batch_size: 32
  • —learning_rate: 2e-05
  • —num_train_epochs: 5
  • —warmup_ratio: 0.1
  • —bf16: True
  • —batch_sampler: no_duplicates
All Hyperparameters

<details><summary>Click to expand</summary>

  • —overwrite_output_dir: False
  • —do_predict: False
  • —eval_strategy: steps
  • —prediction_loss_only: True
  • —per_device_train_batch_size: 32
  • —per_device_eval_batch_size: 32
  • —per_gpu_train_batch_size: None
  • —per_gpu_eval_batch_size: None
  • —gradient_accumulation_steps: 1
  • —eval_accumulation_steps: None
  • —torch_empty_cache_steps: None
  • —learning_rate: 2e-05
  • —weight_decay: 0.0
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —max_grad_norm: 1.0
  • —num_train_epochs: 5
  • —max_steps: -1
  • —lr_scheduler_type: linear
  • —lr_scheduler_kwargs: {}
  • —warmup_ratio: 0.1
  • —warmup_steps: 0
  • —log_level: passive
  • —log_level_replica: warning
  • —log_on_each_node: True
  • —logging_nan_inf_filter: True
  • —save_safetensors: True
  • —save_on_each_node: False
  • —save_only_model: False
  • —restore_callback_states_from_checkpoint: False
  • —no_cuda: False
  • —use_cpu: False
  • —use_mps_device: False
  • —seed: 42
  • —data_seed: None
  • —jit_mode_eval: False
  • —use_ipex: False
  • —bf16: True
  • —fp16: False
  • —fp16_opt_level: O1
  • —half_precision_backend: auto
  • —bf16_full_eval: False
  • —fp16_full_eval: False
  • —tf32: None
  • —local_rank: 0
  • —ddp_backend: None
  • —tpu_num_cores: None
  • —tpu_metrics_debug: False
  • —debug: []
  • —dataloader_drop_last: False
  • —dataloader_num_workers: 0
  • —dataloader_prefetch_factor: None
  • —past_index: -1
  • —disable_tqdm: False
  • —remove_unused_columns: True
  • —label_names: None
  • —load_best_model_at_end: False
  • —ignore_data_skip: False
  • —fsdp: []
  • —fsdp_min_num_params: 0
  • —fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • —fsdp_transformer_layer_cls_to_wrap: None
  • —accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • —parallelism_config: None
  • —deepspeed: None
  • —label_smoothing_factor: 0.0
  • —optim: adamwtorchfused
  • —optim_args: None
  • —adafactor: False
  • —group_by_length: False
  • —length_column_name: length
  • —ddp_find_unused_parameters: None
  • —ddp_bucket_cap_mb: None
  • —ddp_broadcast_buffers: False
  • —dataloader_pin_memory: True
  • —dataloader_persistent_workers: False
  • —skip_memory_metrics: True
  • —use_legacy_prediction_loop: False
  • —push_to_hub: False
  • —resume_from_checkpoint: None
  • —hub_model_id: None
  • —hub_strategy: every_save
  • —hub_private_repo: None
  • —hub_always_push: False
  • —hub_revision: None
  • —gradient_checkpointing: False
  • —gradient_checkpointing_kwargs: None
  • —include_inputs_for_metrics: False
  • —include_for_metrics: []
  • —eval_do_concat_batches: True
  • —fp16_backend: auto
  • —push_to_hub_model_id: None
  • —push_to_hub_organization: None
  • —mp_parameters:
  • —auto_find_batch_size: False
  • —full_determinism: False
  • —torchdynamo: None
  • —ray_scope: last
  • —ddp_timeout: 1800
  • —torch_compile: False
  • —torch_compile_backend: None
  • —torch_compile_mode: None
  • —include_tokens_per_second: False
  • —include_num_input_tokens_seen: False
  • —neftune_noise_alpha: None
  • —optim_target_modules: None
  • —batch_eval_metrics: False
  • —eval_on_start: False
  • —use_liger_kernel: False
  • —liger_kernel_config: None
  • —eval_use_gather_object: False
  • —average_tokens_across_devices: False
  • —prompts: None
  • —batch_sampler: no_duplicates
  • —multi_dataset_batch_sampler: proportional
  • —router_mapping: {}
  • —learning_rate_mapping: {}

</details>

Training Logs

<details><summary>Click to expand</summary>

EpochStepTraining LossValidation Losscosine_ndcg@10
0.02121001.3363--
0.04252000.7106--
0.06373000.5284--
0.08504000.5001--
0.10625000.4747--
0.12746000.4027--
0.14877000.358--
0.16998000.4124--
0.19129000.3492--
0.212410000.3526--
0.233611000.3449--
0.254912000.3557--
0.276113000.3612--
0.297414000.3411--
0.318615000.3405--
0.339816000.3404--
0.361117000.3475--
0.382318000.3582--
0.403619000.3549--
0.424820000.3481--
0.446021000.3217--
0.467322000.33--
0.488523000.3261--
0.509824000.3206--
0.531025000.3505--
0.552326000.3272--
0.573527000.3411--
0.594728000.3147--
0.616029000.3136--
0.637230000.33480.29020.4530
0.658531000.3353--
0.679732000.3214--
0.700933000.3147--
0.722234000.3375--
0.743435000.2972--
0.764736000.3232--
0.785937000.3184--
0.807138000.3424--
0.828439000.3509--
0.849640000.3309--
0.870941000.3365--
0.892142000.3217--
0.913343000.326--
0.934644000.32--
0.955845000.3077--
0.977146000.3237--
0.998347000.3231--
1.019548000.2929--
1.040849000.2858--
1.062050000.2806--
1.083351000.2931--
1.104552000.2975--
1.125753000.2789--
1.147054000.2693--
1.168255000.2638--
1.189556000.2724--
1.210757000.2772--
1.231958000.282--
1.253259000.2681--
1.274460000.26560.28650.4688
1.295761000.2599--
1.316962000.2751--
1.338163000.2812--
1.359464000.28--
1.380665000.2675--
1.401966000.2694--
1.423167000.2598--
1.444468000.2523--
1.465669000.3062--
1.486870000.2895--
1.508171000.2683--
1.529372000.2699--
1.550673000.2537--
1.571874000.2647--
1.593075000.2886--
1.614376000.2797--
1.635577000.2572--
1.656878000.2686--
1.678079000.2702--
1.699280000.2543--
1.720581000.2596--
1.741782000.2537--
1.763083000.2652--
1.784284000.3035--
1.805485000.2709--
1.826786000.2831--
1.847987000.2776--
1.869288000.2483--
1.890489000.2714--
1.911690000.26870.26520.4724
1.932991000.2864--
1.954192000.2692--
1.975493000.2725--
1.996694000.2744--
2.017895000.2361--
2.039196000.2315--
2.060397000.2314--
2.081698000.2391--
2.102899000.2245--
2.1240100000.2106--
2.1453101000.2269--
2.1665102000.2303--
2.1878103000.2476--
2.2090104000.2235--
2.2302105000.2462--
2.2515106000.2428--
2.2727107000.2422--
2.2940108000.2413--
2.3152109000.2394--
2.3364110000.2276--
2.3577111000.2233--
2.3789112000.2135--
2.4002113000.2227--
2.4214114000.2085--
2.4427115000.2497--
2.4639116000.2427--
2.4851117000.2396--
2.5064118000.2437--
2.5276119000.2349--
2.5489120000.2440.27030.4729
2.5701121000.219--
2.5913122000.2293--
2.6126123000.2167--
2.6338124000.2133--
2.6551125000.2279--
2.6763126000.2173--
2.6975127000.219--
2.7188128000.2102--
2.7400129000.2224--
2.7613130000.245--
2.7825131000.2213--
2.8037132000.2513--
2.8250133000.2309--
2.8462134000.2189--
2.8675135000.2073--
2.8887136000.2138--
2.9099137000.2193--
2.9312138000.2133--
2.9524139000.2317--
2.9737140000.227--
2.9949141000.2278--
3.0161142000.2008--
3.0374143000.1826--
3.0586144000.1921--
3.0799145000.1746--
3.1011146000.188--
3.1223147000.2015--
3.1436148000.1943--
3.1648149000.2076--
3.1861150000.19920.26120.4832
3.2073151000.197--
3.2285152000.1912--
3.2498153000.2034--
3.2710154000.1964--
3.2923155000.1775--
3.3135156000.1908--
3.3347157000.1909--
3.3560158000.1841--
3.3772159000.1755--
3.3985160000.1976--
3.4197161000.1894--
3.4410162000.1891--
3.4622163000.1957--
3.4834164000.178--
3.5047165000.1939--
3.5259166000.1874--
3.5472167000.2022--
3.5684168000.1982--
3.5896169000.2121--
3.6109170000.1972--
3.6321171000.1754--
3.6534172000.1889--
3.6746173000.1896--
3.6958174000.1959--
3.7171175000.1864--
3.7383176000.1836--
3.7596177000.1954--
3.7808178000.1888--
3.8020179000.1779--
3.8233180000.21020.24250.4855
3.8445181000.181--
3.8658182000.1721--
3.8870183000.2177--
3.9082184000.1922--
3.9295185000.1696--
3.9507186000.186--
3.9720187000.179--
3.9932188000.1833--
4.0144189000.1596--
4.0357190000.1555--
4.0569191000.1715--
4.0782192000.1739--
4.0994193000.1601--
4.1206194000.1643--
4.1419195000.1507--
4.1631196000.1623--
4.1844197000.177--
4.2056198000.1486--
4.2268199000.1696--
4.2481200000.1541--
4.2693201000.1631--
4.2906202000.1719--
4.3118203000.1722--
4.3331204000.1648--
4.3543205000.1641--
4.3755206000.1704--
4.3968207000.1772--
4.4180208000.1741--
4.4393209000.178--
4.4605210000.16720.24260.4860
4.4817211000.1648--
4.5030212000.1624--
4.5242213000.1717--
4.5455214000.1677--
4.5667215000.1679--
4.5879216000.199--
4.6092217000.1632--
4.6304218000.1647--
4.6517219000.1678--
4.6729220000.1676--
4.6941221000.1521--
4.7154222000.1381--
4.7366223000.1707--
4.7579224000.1543--
4.7791225000.1867--
4.8003226000.1724--
4.8216227000.1527--
4.8428228000.1611--
4.8641229000.1552--
4.8853230000.1527--
4.9065231000.157--
4.9278232000.1604--
4.9490233000.1594--
4.9703234000.1677--
4.9915235000.1583--

</details>

Framework Versions

  • —Python: 3.12.6
  • —Sentence Transformers: 5.2.0
  • —Transformers: 4.56.0
  • —PyTorch: 2.8.0+cu129
  • —Accelerate: 1.10.1
  • —Datasets: 4.4.2
  • —Tokenizers: 0.22.0

Citation

BibTeX

Sentence Transformers
bibtex
@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",
}
MultipleNegativesRankingLoss
bibtex
@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}
}

<!--

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. -->