CoolFace
Modelpublic

meandyou200175/E5_v3_41_instruct_topic

sourceHugging Faceupdated 10mo agoView on Hugging Face
0likes82downloads
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_v3_41_instruct_topic")
# Run inference
sentences = [
    'task: classification | query: Từ vựng các loại biển báo giao thông\nBổ sung vốn từ ngay bạn nhé\n#giaoduc\n#hoctap\n#sinhvien\n#hoctienganh\n#tuyensinh\n#luyenthi\n#truonghoc\n#giaovien\n#daihoc\n#giaoducsom',
    'Học tập - Kỹ năng',
    'Học tập - Kỹ năng',
]
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.4971, 0.4971],
#         [0.4971, 1.0000, 1.0000],
#         [0.4971, 1.0000, 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.2397
cosine_accuracy@20.3253
cosine_accuracy@50.4605
cosine_accuracy@100.5887
cosine_accuracy@1000.9418
cosine_precision@10.2397
cosine_precision@20.1626
cosine_precision@50.0921
cosine_precision@100.0589
cosine_precision@1000.0094
cosine_recall@10.2397
cosine_recall@20.3253
cosine_recall@50.4605
cosine_recall@100.5887
cosine_recall@1000.9418
cosine_ndcg@100.3952
cosine_mrr@10.2397
cosine_mrr@20.2825
cosine_mrr@50.3192
cosine_mrr@100.3358
cosine_mrr@1000.3506
cosine_map@1000.3506

<!--

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: 209,302 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: 12 tokens</li><li>mean: 102.33 tokens</li><li>max: 495 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 6.59 tokens</li><li>max: 28 tokens</li></ul> |
  • Samples: | anchor | positive | |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------| | <code>task: classification \| query: Kho đạn triều Nguyễn hoả dược khố</code> | <code>Lịch sử</code> | | <code>task: classification \| query: PIQU Nguồn: klapty</code> | <code>Âm nhạc</code> | | <code>task: classification \| query: Bãi Dâu Vũng Tàu<br>Bãi Dâu Vũng Tàu tọa lạc ở đường Trần Phú, Thành phố Vũng Tàu - Đây là một trong những con đường khá lớn, nổi tiếng tại Vũng Tàu nên bạn có thể dễ dàng tìm thấy nó.<br>Theo người dân địa phương nơi đây kể lại, bãi Dâu có tên gọi cũ là bãi Vũng Mây, tên gọi này được đặt dựa trên khung cảnh thiên nhiên được bao phủ rất nhiều mây rừng. Nơi này khá kín gió và bạn có thể thấy nhiều mỏm đá lớn nhô ra ở ngoài biển ở hai đầu bãi.<br>Đặc biệt, bãi Dâu nổi tiếng với vẻ đẹp hoang sơ của thiên nhiên, nó vốn chưa được nhiều người biết đến và chưa được khai thác nhiều. Cũng chính vì điều đó mà bãi Dâu đã sở hữu một đặc trưng về diện mạo hoang sơ mà không phải bất kỳ bãi biển nào tại Vũng Tàu cũng có.<br><br>#vietnam360 #yoolife #dulich #vietnam #34tinhthanh #vr360vietnam #vr360thanhphohochiminh #vr360baidauvungtau #ba</code> | <code>Danh lam thắng cả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: 2,115 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: 98.78 tokens</li><li>max: 308 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 7.06 tokens</li><li>max: 42 tokens</li></ul> |
  • Samples: | anchor | positive | |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------| | <code>task: classification \| query: Hội trường gác 2 9 Nguyễn Đình Chiểu, Hà Nội chật kín dự. Sự choán, chiếm thời gian phát biểu yếu nhân Hội Nhà văn, Nguyễn Quang Thiều, Trần Đăng Khoa, Nguyễn Bình Phương, Hữu Thỉnh… mắt sách Nhà văn chữ tình gởi tác giả niên Trình Quang Phú toát yếu hội thảo sách. Cuốn sách 400 trang in đẹp 25 chân dung thảy. Tác giả Trình, Trình Quang Phú- hiếm. Trước lầm cầu sông Sài Gòn tướng Trịnh Minh Thế. Chả phải. Mà Trình. Một dịp hợp, viết đọc cố hương gốc tổ Trình xứ Thanh. Ông đại tá an ninh, văn báo, nhiếp ảnh, doanh nhân thành chủ ngơi Tập đoàn Sao Việt đất Tuy Hòa. Và chức hiện đương Viện trưởng Viện Nghiên cứu phát triển trực Liên hiệp Hội KHKT Việt Nam. Tất tật đều… trúng cả! Tôi đương nhắc tắc nhẽ diễn giả. Tất thảy luyến láy duyên độc đáo chi tiết bầu thành công ký tạm gọi tiểu sử này.</code> | <code>Thời sự</code> | | <code>task: sentence similarity \| query: luyện tập một cách thường xuyên để đạt tới những phẩm chất hay trình độ ở một mức nào đó</code> | <code>rèn luyện thân thể</code> | | <code>task: sentence similarity \| query: gắn thêm từng mảnh trên bề mặt, thường để trang trí</code> | <code>mũ dát ngọc</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.01531002.2648--
0.03062001.6187--
0.04593001.1877--
0.06124001.0249--
0.07645000.834--
0.09176000.7643--
0.10707000.6765--
0.12238000.6221--
0.13769000.5857--
0.152910000.6021--
0.168211000.533--
0.183512000.5379--
0.198713000.5024--
0.214014000.526--
0.229315000.5062--
0.244616000.4948--
0.259917000.4907--
0.275218000.5126--
0.290519000.4958--
0.305820000.4897--
0.321121000.4838--
0.336322000.491--
0.351623000.4672--
0.366924000.4607--
0.382225000.4793--
0.397526000.4611--
0.412827000.5091--
0.428128000.4672--
0.443429000.4839--
0.458630000.47310.30010.3636
0.473931000.4894--
0.489232000.4746--
0.504533000.4812--
0.519834000.5015--
0.535135000.4761--
0.550436000.4737--
0.565737000.4576--
0.581038000.4838--
0.596239000.4468--
0.611540000.4603--
0.626841000.4577--
0.642142000.4826--
0.657443000.4647--
0.672744000.443--
0.688045000.4837--
0.703346000.444--
0.718547000.44--
0.733848000.4722--
0.749149000.4405--
0.764450000.4659--
0.779751000.4898--
0.795052000.4623--
0.810353000.4422--
0.825654000.4493--
0.840955000.4258--
0.856156000.4608--
0.871457000.466--
0.886758000.4384--
0.902059000.4681--
0.917360000.45570.25460.3756
0.932661000.462--
0.947962000.4506--
0.963263000.4681--
0.978464000.3216--
0.993765000.0--
1.009066000.2507--
1.024367000.39--
1.039668000.4508--
1.054969000.3984--
1.070270000.3917--
1.085571000.4115--
1.100772000.3904--
1.116073000.4149--
1.131374000.4025--
1.146675000.4211--
1.161976000.4143--
1.177277000.4383--
1.192578000.4389--
1.207879000.4438--
1.223180000.4031--
1.238381000.4262--
1.253682000.3857--
1.268983000.4336--
1.284284000.4056--
1.299585000.4019--
1.314886000.3842--
1.330187000.3971--
1.345488000.4006--
1.360689000.3851--
1.375990000.41220.25390.3787
1.391291000.3794--
1.406592000.39--
1.421893000.3977--
1.437194000.4046--
1.452495000.3965--
1.467796000.3736--
1.483097000.3906--
1.498298000.3918--
1.513599000.381--
1.5288100000.3736--
1.5441101000.3982--
1.5594102000.3903--
1.5747103000.3835--
1.5900104000.403--
1.6053105000.3852--
1.6205106000.3736--
1.6358107000.3955--
1.6511108000.4048--
1.6664109000.3783--
1.6817110000.3751--
1.6970111000.3823--
1.7123112000.3929--
1.7276113000.3927--
1.7429114000.3936--
1.7581115000.4135--
1.7734116000.3931--
1.7887117000.3613--
1.8040118000.3934--
1.8193119000.3767--
1.8346120000.38360.24320.3877
1.8499121000.3665--
1.8652122000.3524--
1.8804123000.3877--
1.8957124000.3695--
1.9110125000.3747--
1.9263126000.3914--
1.9416127000.3678--
1.9569128000.3662--
1.9722129000.3712--
1.9875130000.0396--
2.0028131000.0643--
2.0180132000.3485--
2.0333133000.3328--
2.0486134000.3405--
2.0639135000.318--
2.0792136000.3246--
2.0945137000.319--
2.1098138000.3426--
2.1251139000.3352--
2.1403140000.3555--
2.1556141000.3716--
2.1709142000.3361--
2.1862143000.327--
2.2015144000.3354--
2.2168145000.3272--
2.2321146000.3296--
2.2474147000.3652--
2.2627148000.3218--
2.2779149000.3347--
2.2932150000.33020.23990.3843
2.3085151000.321--
2.3238152000.3154--
2.3391153000.3328--
2.3544154000.348--
2.3697155000.3565--
2.3850156000.3332--
2.4002157000.3489--
2.4155158000.3323--
2.4308159000.3419--
2.4461160000.3223--
2.4614161000.351--
2.4767162000.3349--
2.4920163000.3273--
2.5073164000.324--
2.5226165000.3575--
2.5378166000.3539--
2.5531167000.3612--
2.5684168000.3272--
2.5837169000.3587--
2.5990170000.3389--
2.6143171000.3067--
2.6296172000.3228--
2.6449173000.337--
2.6601174000.33--
2.6754175000.3502--
2.6907176000.3449--
2.7060177000.313--
2.7213178000.339--
2.7366179000.3446--
2.7519180000.33640.23600.3862
2.7672181000.3342--
2.7824182000.3198--
2.7977183000.3294--
2.8130184000.3464--
2.8283185000.3322--
2.8436186000.3247--
2.8589187000.3176--
2.8742188000.299--
2.8895189000.3391--
2.9048190000.3395--
2.9200191000.2967--
2.9353192000.3313--
2.9506193000.3257--
2.9659194000.3381--
2.9812195000.1769--
2.9965196000.0--
3.0118197000.23--
3.0271198000.27--
3.0423199000.2895--
3.0576200000.2997--
3.0729201000.3011--
3.0882202000.2903--
3.1035203000.3038--
3.1188204000.3014--
3.1341205000.2972--
3.1494206000.3026--
3.1647207000.2948--
3.1799208000.3023--
3.1952209000.3069--
3.2105210000.28360.24090.3918
3.2258211000.281--
3.2411212000.2886--
3.2564213000.3058--
3.2717214000.2907--
3.2870215000.278--
3.3022216000.3107--
3.3175217000.3038--
3.3328218000.3039--
3.3481219000.2796--
3.3634220000.3118--
3.3787221000.2984--
3.3940222000.2832--
3.4093223000.2826--
3.4246224000.2811--
3.4398225000.2894--
3.4551226000.305--
3.4704227000.3019--
3.4857228000.2918--
3.5010229000.268--
3.5163230000.2797--
3.5316231000.2812--
3.5469232000.2917--
3.5621233000.2825--
3.5774234000.2918--
3.5927235000.2665--
3.6080236000.2785--
3.6233237000.2972--
3.6386238000.2844--
3.6539239000.267--
3.6692240000.27430.24250.4022
3.6845241000.2935--
3.6997242000.2922--
3.7150243000.2917--
3.7303244000.2899--
3.7456245000.2761--
3.7609246000.2971--
3.7762247000.2955--
3.7915248000.3049--
3.8068249000.2853--
3.8220250000.2872--
3.8373251000.2703--
3.8526252000.2856--
3.8679253000.2882--
3.8832254000.2916--
3.8985255000.2693--
3.9138256000.28--
3.9291257000.2781--
3.9444258000.2693--
3.9596259000.2844--
3.9749260000.275--
3.9902261000.0--
4.0055262000.1056--
4.0208263000.254--
4.0361264000.2548--
4.0514265000.2698--
4.0667266000.2637--
4.0819267000.2536--
4.0972268000.2792--
4.1125269000.2743--
4.1278270000.27710.24030.4027
4.1431271000.2379--
4.1584272000.2429--
4.1737273000.2656--
4.1890274000.2767--
4.2043275000.2727--
4.2195276000.2375--
4.2348277000.2632--
4.2501278000.2371--
4.2654279000.2429--
4.2807280000.2651--
4.2960281000.2409--
4.3113282000.2475--
4.3266283000.2505--
4.3418284000.254--
4.3571285000.268--
4.3724286000.2461--
4.3877287000.2616--
4.4030288000.2421--
4.4183289000.2482--
4.4336290000.244--
4.4489291000.2544--
4.4641292000.2586--
4.4794293000.2807--
4.4947294000.2537--
4.5100295000.2524--
4.5253296000.2499--
4.5406297000.2532--
4.5559298000.264--
4.5712299000.2625--
4.5865300000.25340.23620.3952
4.6017301000.2517--
4.6170302000.2416--
4.6323303000.2685--
4.6476304000.2603--
4.6629305000.2398--
4.6782306000.2556--
4.6935307000.2529--
4.7088308000.2429--
4.7240309000.247--
4.7393310000.2499--
4.7546311000.2616--
4.7699312000.2451--
4.7852313000.2387--
4.8005314000.2409--
4.8158315000.2575--
4.8311316000.2296--
4.8464317000.2203--
4.8616318000.2289--
4.8769319000.2372--
4.8922320000.2579--
4.9075321000.2472--
4.9228322000.2763--
4.9381323000.2404--
4.9534324000.2533--
4.9687325000.2468--
4.9839326000.0929--
4.9992327000.0--

</details>

Framework Versions

  • Python: 3.12.6
  • Sentence Transformers: 5.1.2
  • Transformers: 4.56.0
  • PyTorch: 2.8.0+cu129
  • Accelerate: 1.10.1
  • Datasets: 4.4.1
  • 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. -->