pilllll's picture
Upload 8 files
9a3f42e verified
metadata
tags:
  - sentence-transformers
  - sentence-similarity
  - feature-extraction
  - dense
  - generated_from_trainer
  - dataset_size:132830
  - loss:MultipleNegativesRankingLoss
base_model: intfloat/multilingual-e5-large
widget:
  - source_sentence: 'query: 伤科方'
    sentences:
      - >-
        passage: title: 骨伤科效方集 author: Gengmin Tang category: Orthopedics,
        Medicine formulae, receipts, prescriptions, 伤科方 description: 
      - >-
        passage: title: พูดด้วยภาพ 2 : เทคนิคทำสไลด์เป็นภาพง่าย ๆ ใน 2 ขั้นตอน
        author: สุธาพร ล้ำเลิศกุล. category: Microsoft PowerPoint (Computer
        file), Presentation graphics software, Business presentations,
        การออกแบบกราฟิก description: จบปัญหา "ไม่มีเวลา" และ "ไม่มีเทคนิค"
        ในการทำสไลด์ หนังสือ "พูดด้วยภาพ 2 : ทำสไลด์เป็นภาพง่าย ๆ ใน 2 ขั้นตอน"
        เล่มนี้ จะสอนให้คุณคิดและทำสไลด์อย่างมีระบบใน 2 ขั้นตอน
        โดยคุณสามารถเลือกเรียนรู้เฉพาะบท
        และลงมือทำได้แบบไม่จำเป็นต้องอ่านตั้งแต่ต้นจนจบ ย่อยข้อมูล "ยาก" ให้เป็น
        "ภาพ" ที่เข้าใจง่าย พร้อม Link Youtube Video สอนในเล่ม ลด ขั้นตอน เพิ่ม
        ความแตกต่าง ทำสไลด์ให้ สนุก สวยงาม
        และสื่อสารให้เกิดประโยชน์สูงสุดแก่ผู้ฟัง ตามแบบฉบับของ "BetterPitch"
        สถาบันสอนการทำสไลด์ในองค์กรชั้นนำทั่วประเทศ!
      - >-
        passage: title: 福慧之道 author: Yinai Sun category: Happiness, Well-being,
        Conduct of life, Human comfort, Bonheur, Bien-être, Morale pratique,
        ethics (philosophical concept), comfort (sensation), Fo jiao Ren sheng
        zhe xue Tong su du wu description: Ben shu shi dui zheng ge zhong hua
        wen hua de zong jie, jiang shu ji fu ji hui de fang fa. nei rong bao gua
        : fu mai yu hui mai : ren sheng de xing fu er mai ; ru he jie fu hui er
        mai ; cai fu fu tian ; zhi hui fu tian ; fu tian fa ze ; ri xing yi shan
        ; fu hui ren sheng
  - source_sentence: 'query: แนะนำหนังสือการจัดการธุรกิจ'
    sentences:
      - >-
        passage: title: กุญแจ 5 ดอก ขจัดข้อขัดแย้งในองค์งาน author: ปรีชา
        ทิวะหุต. category: การจัดการธุรกิจ, การจัดองค์การ description: 
      - >-
        passage: title: มานุษยวิทยากายภาพ : วิวัฒนาการทางกายภาพและวัฒนธรรม
        author: งามพิศ สัตย์สงวน category: มานุษยวิทยา, มนุษย์กับวัฒนธรรม,
        มนุษยวิทยากายภาพ description: 
      - >-
        passage: title: พีระพงศ์อนุสรณ์ author: N/A category: Birabhongse
        Kasemsri, M.L., 1935-2000, Diplomats Thailand Biography, ชีวประวัติ,
        หนังสืออนุสรณ์งานศพ description: ในวาระครบ 5
        ปีแห่งการถึงแก่อนิจกรรมของหม่อมหลวงพีระพงศ์ เกษมศรี
        ครอบครัวของหม่อมหลวงพีระพงศ์ฯ ได้จัดทำหนังสือ "พีระพงศ์อนุสรณ์"
        เป็นเครื่องสำนึกถึงชีวิตและงานของหม่อมหลวงพีระพงศ์ฯ
        จุดมุ่งประสงค์เหนือสิ่งอื่นใดของหนังสือนี้
        ก็เพื่อเป็นอนุสรณ์ถึงความจงรักภักดีอุทิศตนถวายของหม่อมหลวงพีระพงศ์ฯ
        ต่อสถาบันพระมหากษัตริย์ ต่อพระบรมราชจักรีวงศ์
        และต่อองคืพระบาทสมเด็จพระเจ้าอยู่หัวและสมเด็จพระนางเจ้าฯพระบรมราชินีนาถ
        ตลอดจนพระบรมวงศานุวงศ์ทุกพระองค์
  - source_sentence: 'query: เริ่มต้นManipulation, Orthopedicควรอ่านอะไร'
    sentences:
      - >-
        passage: title: 實用筋膜操作指引 = A practical guide to fascial manipulation
        author: 盧奧馬拉 (Luomala, Tuulia), 文字作者 category: Manipulation
        (Therapeutics), Fasciae (Anatomy), Manipulation, Orthopedic, Fascia,
        Manipulation (Thérapeutique), Ji jin mo fang song shu description: 
      - >-
        passage: title: Opioid sensitivity of chronic noncancer pain author:
        Eija Kalso category: Opioids Therapeutic use Congresses, Chronic pain
        Chemotherapy Congresses, Opioids Receptors Congresses, Pain drug
        therapy, Analgesics, Opioid therapeutic use, Chronic Disease drug
        therapy, Receptors, Opioid physiology, Douleur chronique Chimiothérapie
        Congrès, Opioïdes Emploi en thérapeutique Congrès, Opioïdes
        Récepteurs Congrès, Opioids Receptors, Opioids Therapeutic use,
        Analgésiques morphiniques usage thérapeutique, Maladie chronique
        traitement médicamenteux, Récepteur endorphine, Chronischer Schmerz,
        Opioide, Kongress, Opiatrezeptor, Analgesie, Opiate, Congress,
        Conference papers and proceedings, Actes de congrès description:
        Contains papers from the first international research symposium of the
        International Association for the Study of Pain, held in Helsinki,
        Finland, Fall 1998. Focus is on opioid responsiveness to neuropathic
        pain. Papers are arranged in sections on function and dysfunction of
        opioid receptors, clinical pharmacology of opioids, understanding and
        improving opioid sensitivity, and opioid sensitivity of different
        chronic pain states. Specific topics include targeting of opioid
        receptors to presynaptic sites, route of opioid administration,
        phenotypic changes induced in dorsal root ganglion neurons by nerve
        injury, and opioids in headache. Kalso is currently affiliated with the
        Karolinska Institute in Sweden. IASP member price, $44.85. Annotation
        copyrighted by Book News, Inc., Portland, OR
      - >-
        passage: title: พลิกคัมภีร์ตีแตกเศรษฐกิจไทย = Thailand's economic
        outlook 2009 author: วีระศักดิ์ พงศ์อักษร. category: ปัญหาเศรษฐกิจ ไทย,
        ไทย ภาวะเศรษฐกิจ, ไทย ภาวะสังคม description: 
  - source_sentence: 'query: เริ่มต้นทางรถไฟ ไทย กาญจนบุรีควรอ่านอะไร'
    sentences:
      - >-
        passage: title: คู่มือคำศัพท์ช่วยเหลือนักท่องเที่ยวเบื้องต้น (ภาษาจีน)
        พร้อมภาพประกอบ author: ชัยพันธุ์ สิทธิสุวรรณกุล category: คำศัพท์,
        ภาษาจีน คู่มือ, นักท่องเที่ยว description: 
      - >-
        passage: title: ทางรถไฟสายมรณะ author: N/A category: ทางรถไฟ ไทย
        กาญจนบุรี description: 
      - >-
        passage: title: ยุทธศาสตร์ชาติว่าด้วยการป้องกันและปราบปรามการทุจริต
        ระยะที่ 3 (พ.ศ. 2560-2564) author:
        คณะกรรมการป้องกันและปราบปรามการทุจริตแห่งชาติ category:
        การทุจริตและประพฤติมิชอบ ไทย, การทุจริตและประพฤติมิชอบในวงราชการ ไทย
        ยุทธศาสตร์, ยุทธศาสตร์, การฉ้อราษฎร์บังหลวง ไทย การป้องกัน description: 
  - source_sentence: 'query: หนังสือนิทาน'
    sentences:
      - >-
        passage: title: เด็กหญิงข้าวเปลือก author: หยาดฝน ธัญโชติกานต์.
        category: นิทาน description: 
      - >-
        passage: title: Current drug discovery technologies author: N/A
        category: Drugs Design Periodicals, Pharmaceutical technology
        Periodicals, Drug Design, Technology, Pharmaceutical, Drugs Design,
        Pharmaceutical technology, Periodicals description: 
      - >-
        passage: title: 汉语词汇・句法・语音的相互关联 : 第二届肯特岗国际汉语语言学圆桌会议论文集 = Interface in
        Chinese : morphology, syntax and phonetics author: Kent Ridge
        International Roundtable Conference on Chinese linguistics category:
        Chinese language Grammar Congresses, Chinese language Congresses,
        Chinois (Langue) Grammaire Congrès, Chinois (Langue) Congrès, Han yu
        yu yan xue guo ji xue shu hui yi hui yi lu, Chinese language, Chinese
        language Grammar, Conference papers and proceedings, Conversation and
        phrase books description: 
pipeline_tag: sentence-similarity
library_name: sentence-transformers

SentenceTransformer based on intfloat/multilingual-e5-large

This is a sentence-transformers model finetuned from intfloat/multilingual-e5-large. 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: intfloat/multilingual-e5-large
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 1024 dimensions
  • Similarity Function: Cosine Similarity

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:

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("sentence_transformers_model_id")
# Run inference
sentences = [
    'query: หนังสือนิทาน',
    'passage: title: เด็กหญิงข้าวเปลือก author: หยาดฝน ธัญโชติกานต์. category: นิทาน description: ',
    'passage: title: Current drug discovery technologies author: N/A category: Drugs Design Periodicals, Pharmaceutical technology Periodicals, Drug Design, Technology, Pharmaceutical, Drugs Design, Pharmaceutical technology, Periodicals description: ',
]
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.7672, -0.0610],
#         [ 0.7672,  1.0000,  0.0661],
#         [-0.0610,  0.0661,  1.0000]])

Training Details

Training Dataset

Unnamed Dataset

  • Size: 132,830 training samples
  • Columns: sentence_0, sentence_1, and sentence_2
  • Approximate statistics based on the first 1000 samples:
    sentence_0 sentence_1 sentence_2
    type string string string
    details
    • min: 6 tokens
    • mean: 14.35 tokens
    • max: 38 tokens
    • min: 17 tokens
    • mean: 90.98 tokens
    • max: 512 tokens
    • min: 19 tokens
    • mean: 87.53 tokens
    • max: 512 tokens
  • Samples:
    sentence_0 sentence_1 sentence_2
    query: ไสยศาสตร์ สำหรับมือใหม่ passage: title: สถานการณ์พระพุทธศาสนา : กระแสไสยศาสตร์ author: พระธรรมปิฎก (ป.อ. ปยุตฺโต) category: ไสยศาสตร์, พุทธศาสนากับไสยศาสตร์ description: passage: title: Hospitality marketing management author: Robert D. Reid category: Hospitality industry Marketing, Food service Marketing, Restaurants Marketing, Accueil (Tourisme) Marketing, Services alimentaires Marketing, Marketing, Tiếp thị, Hospitality industry, Khách sạn, Dịch vụ ăn uống, Restaurants, Quán ăn description:
    query: 伤科方 passage: title: 骨伤科效方集 author: Gengmin Tang category: Orthopedics, Medicine formulae, receipts, prescriptions, 伤科方 description: passage: title: 福慧之道 author: Yinai Sun category: Happiness, Well-being, Conduct of life, Human comfort, Bonheur, Bien-être, Morale pratique, ethics (philosophical concept), comfort (sensation), Fo jiao Ren sheng zhe xue Tong su du wu description: Ben shu shi dui zheng ge zhong hua wen hua de zong jie, jiang shu ji fu ji hui de fang fa. nei rong bao gua : fu mai yu hui mai : ren sheng de xing fu er mai ; ru he jie fu hui er mai ; cai fu fu tian ; zhi hui fu tian ; fu tian fa ze ; ri xing yi shan ; fu hui ren sheng
    query: basic Acid-Base Imbalance problems book passage: title: Acid-base, fluids, and electrolytes made ridiculously simple author: Richard A. Preston category: Acid-Base Imbalance problems, Body Fluids problems, Water-Electrolyte Imbalance problems, Water-electrolyte imbalance description: passage: title: Fetal and neonatal neurology and neurosurgery author: Malcolm I. Levene category: Brain Diseases, Newborn infants, Nervous system Surgery, Nervous system Diseases, Brain embryology, Fetal Diseases therapy, Infant, Newborn, Neurosurgery, Prenatal Diagnosis methods, Ultrasonography methods, Neurosurgical Procedures, Cerveau Maladies, Nouveau-nés, Neurochirurgie, Système nerveux Maladies description:
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim",
        "gather_across_devices": false,
        "directions": [
            "query_to_doc"
        ],
        "partition_mode": "joint",
        "hardness_mode": null,
        "hardness_strength": 0.0
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 64
  • per_device_eval_batch_size: 64
  • num_train_epochs: 1
  • fp16: True
  • multi_dataset_batch_sampler: round_robin

All Hyperparameters

Click to expand
  • do_predict: False
  • eval_strategy: no
  • prediction_loss_only: True
  • per_device_train_batch_size: 64
  • per_device_eval_batch_size: 64
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 5e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1
  • num_train_epochs: 1
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: None
  • warmup_ratio: None
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • enable_jit_checkpoint: False
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • use_cpu: False
  • seed: 42
  • data_seed: None
  • bf16: False
  • fp16: True
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: -1
  • ddp_backend: None
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • parallelism_config: None
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch_fused
  • optim_args: None
  • group_by_length: False
  • length_column_name: length
  • project: huggingface
  • trackio_space_id: trackio
  • 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
  • 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_for_metrics: []
  • eval_do_concat_batches: True
  • auto_find_batch_size: False
  • full_determinism: False
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • include_num_input_tokens_seen: no
  • 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: True
  • use_cache: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Epoch Step Training Loss
0.2408 500 0.4763
0.4817 1000 0.1799
0.7225 1500 0.1731
0.9634 2000 0.1628

Framework Versions

  • Python: 3.12.13
  • Sentence Transformers: 5.3.0
  • Transformers: 5.0.0
  • PyTorch: 2.10.0+cu128
  • Accelerate: 1.13.0
  • Datasets: 4.0.0
  • Tokenizers: 0.22.2

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",
}

MultipleNegativesRankingLoss

@misc{oord2019representationlearningcontrastivepredictive,
      title={Representation Learning with Contrastive Predictive Coding},
      author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
      year={2019},
      eprint={1807.03748},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1807.03748},
}