SentenceTransformer based on BAAI/bge-m3

This is a sentence-transformers model finetuned from BAAI/bge-m3. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for retrieval.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: BAAI/bge-m3
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 1024 dimensions
  • Similarity Function: Cosine Similarity
  • Supported Modality: Text

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'XLMRobertaModel'})
  (1): Pooling({'embedding_dimension': 1024, 'pooling_mode': 'cls', '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("ani122312/bge-m3-hamsai-finetuned")
# Run inference
sentences = [
    'اشرح سياسة commercial المرتبطة بهذا المستند.',
    'Subscription Pricing section 7 applies to HamsAI SmartDesk customers in Jeddah. The primary rule for SaaS Pro is 2 business days, while the escalation or completion target for Enterprise Suite is 5 business days. Customers must submit the request through the HamsAI portal and include the contract id, invoice date, customer name, city, and affected service. The standard administrative amount for this case is SAR 675, and the equivalent reference value is also recorded with Eastern Arabic numeral marker ٧. Exceptions require written approval from the enterprise success manager. This section is intentionally close to other pricing sections so retrieval must distinguish numbers, product names, dates, and negation. The policy is effective from 30 May 2026 and remains valid until replaced by a newer document. Source evidence must cite this exact document when answering.',
    'Subscription Pricing section 4 applies to Ergonomic Chair Pro customers in Jeddah. The primary rule for SaaS Pro is 5 business days, while the escalation or completion target for Enterprise Suite is 8 business days. Customers must submit the request through the HamsAI portal and include the contract id, invoice date, customer name, city, and affected service. The standard administrative amount for this case is SAR 450, and the equivalent reference value is also recorded with Eastern Arabic numeral marker ٤. Exceptions require written approval from the enterprise success manager. This section is intentionally close to other pricing sections so retrieval must distinguish numbers, product names, dates, and negation. The policy is effective from 30 May 2026 and remains valid until replaced by a newer document. Source evidence must cite this exact document when answering.',
]
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.2996, 0.3105],
#         [0.2996, 1.0000, 0.1838],
#         [0.3105, 0.1838, 1.0000]])

Training Details

Training Dataset

Unnamed Dataset

  • Size: 700 training samples
  • Columns: anchor, positive, and negative
  • Approximate statistics based on the first 100 samples:
    anchor positive negative
    type string string string
    modality text text text
    details
    • min: 12 tokens
    • mean: 17.43 tokens
    • max: 27 tokens
    • min: 166 tokens
    • mean: 180.54 tokens
    • max: 195 tokens
    • min: 166 tokens
    • mean: 181.09 tokens
    • max: 192 tokens
  • Samples:
    anchor positive negative
    Which customer condition applies according to Returns and Exchange Policy - Section 5? Returns and Exchange Policy section 5 applies to HamsAI Cloud ERP customers in Dammam. The primary rule for return window is 6 business days, while the escalation or completion target for refund is 9 business days. Customers must submit the request through the HamsAI portal and include the contract id, invoice date, customer name, city, and affected service. The standard administrative amount for this case is SAR 525, and the equivalent reference value is also recorded with Eastern Arabic numeral marker ٥. Exceptions require written approval from the enterprise success manager. This section is intentionally close to other returns sections so retrieval must distinguish numbers, product names, dates, and negation. The policy is effective from 30 May 2026 and remains valid until replaced by a newer document. Source evidence must cite this exact document when answering. Returns and Exchange Policy section 2 applies to HamsAI SmartDesk customers in Dammam. The primary rule for return window is 3 business days, while the escalation or completion target for refund is 6 business days. Customers must submit the request through the HamsAI portal and include the contract id, invoice date, customer name, city, and affected service. The standard administrative amount for this case is SAR 300, and the equivalent reference value is also recorded with Eastern Arabic numeral marker ٢. Exceptions require written approval from the enterprise success manager. This section is intentionally close to other returns sections so retrieval must distinguish numbers, product names, dates, and negation. The policy is effective from 30 May 2026 and remains valid until replaced by a newer document. Source evidence must cite this exact document when answering.
    كم تبلغ الرسوم أو المهلة المذكورة في infrastructure_mixed_005؟ يوضح هذا المستند المختلط Mixed Policy رقم 5 قواعد متطلبات البنية التحتية الخاصة بـ نظام HamsAI Cloud ERP / HamsAI Cloud ERP. The operational threshold for PostgreSQL is 45 requests per month (٤٥ طلب)، and the fee for exceeding it is SAR 850. يجب استخدام المصطلح التقني Docker كما هو في تذاكر الدعم لأن فرق التشغيل في الرياض وجدة والدمام تعتمد عليه في التصنيف. If the customer asks in Arabic, the answer may still need to retrieve this mixed document because the product name, API code, or SLA label appears in English. لا يجوز تعميم هذه القاعدة على منتجات أخرى، ولا تنطبق عند وجود إعفاء مكتوب في العقد. Effective date: 30 May 2026. ينطبق قسم دليل واجهات API رقم 3 على عملاء خزانة HamsAI ServerRack X1 في الرياض. القاعدة الأساسية الخاصة بـ مصادقة OAuth2 هي 5 أيام عمل، بينما تكون مهلة حد الطلبات 9 أيام عمل من تاريخ قبول الطلب. يجب على العميل إرسال الطلب من خلال بوابة HamsAI مع رقم العقد وتاريخ الفاتورة واسم العميل والمدينة والخدمة المتأثرة. تبلغ الرسوم الإدارية لهذه الحالة 470 ريال سعودي (٤٧٠ ر.س). لا يتم تطبيق الاستثناءات إلا بعد موافقة مكتوبة من مدير نجاح العملاء. تم تصميم هذا النص ليكون قريباً دلالياً من أقسام أخرى في api حتى يختبر النظام الأرقام والتواريخ والأسماء وحالات النفي بدقة. تسري السياسة اعتباراً من 30 مايو 2026 ويجب الاستشهاد بهذا المستند تحديداً عند الإجابة.
    What is the SAR fee and Arabic condition in متطلبات البنية التحتية - Infrastructure Requirements 2? يوضح هذا المستند المختلط Mixed Policy رقم 2 قواعد متطلبات البنية التحتية الخاصة بـ مكتب HamsAI SmartDesk / HamsAI SmartDesk. The operational threshold for PostgreSQL is 30 requests per month (٣٠ طلب)، and the fee for exceeding it is SAR 520. يجب استخدام المصطلح التقني Docker كما هو في تذاكر الدعم لأن فرق التشغيل في الرياض وجدة والدمام تعتمد عليه في التصنيف. If the customer asks in Arabic, the answer may still need to retrieve this mixed document because the product name, API code, or SLA label appears in English. لا يجوز تعميم هذه القاعدة على منتجات أخرى، ولا تنطبق عند وجود إعفاء مكتوب في العقد. Effective date: 30 May 2026. يوضح هذا المستند المختلط Mixed Policy رقم 6 قواعد متطلبات البنية التحتية الخاصة بـ نظام HamsAI Core CRM / HamsAI Core CRM. The operational threshold for PostgreSQL is 50 requests per month (٥٠ طلب)، and the fee for exceeding it is SAR 960. يجب استخدام المصطلح التقني Docker كما هو في تذاكر الدعم لأن فرق التشغيل في الرياض وجدة والدمام تعتمد عليه في التصنيف. If the customer asks in Arabic, the answer may still need to retrieve this mixed document because the product name, API code, or SLA label appears in English. لا يجوز تعميم هذه القاعدة على منتجات أخرى، ولا تنطبق عند وجود إعفاء مكتوب في العقد. Effective date: 30 May 2026.
  • Loss: TripletLoss with these parameters:
    {
        "distance_metric": "TripletDistanceMetric.EUCLIDEAN",
        "triplet_margin": 5
    }
    

Evaluation Dataset

Unnamed Dataset

  • Size: 120 evaluation samples
  • Columns: anchor, positive, and negative
  • Approximate statistics based on the first 100 samples:
    anchor positive negative
    type string string string
    modality text text text
    details
    • min: 12 tokens
    • mean: 17.99 tokens
    • max: 29 tokens
    • min: 167 tokens
    • mean: 177.42 tokens
    • max: 194 tokens
    • min: 167 tokens
    • mean: 180.04 tokens
    • max: 194 tokens
  • Samples:
    anchor positive negative
    What fee, date, or deadline is stated in api_en_001? API Integration Guide section 1 applies to HamsAI Core CRM customers in Jeddah. The primary rule for OAuth2 is 2 business days, while the escalation or completion target for rate limit is 5 business days. Customers must submit the request through the HamsAI portal and include the contract id, invoice date, customer name, city, and affected service. The standard administrative amount for this case is SAR 225, and the equivalent reference value is also recorded with Eastern Arabic numeral marker ١. Exceptions require written approval from the enterprise success manager. This section is intentionally close to other api sections so retrieval must distinguish numbers, product names, dates, and negation. The policy is effective from 30 May 2026 and remains valid until replaced by a newer document. Source evidence must cite this exact document when answering. ينطبق قسم متطلبات البنية التحتية رقم 2 على عملاء مكتب HamsAI SmartDesk في الدمام. القاعدة الأساسية الخاصة بـ أنوية المعالج هي 4 أيام عمل، بينما تكون مهلة الذاكرة 8 أيام عمل من تاريخ قبول الطلب. يجب على العميل إرسال الطلب من خلال بوابة HamsAI مع رقم العقد وتاريخ الفاتورة واسم العميل والمدينة والخدمة المتأثرة. تبلغ الرسوم الإدارية لهذه الحالة 380 ريال سعودي (٣٨٠ ر.س). لا يتم تطبيق الاستثناءات إلا بعد موافقة مكتوبة من مدير نجاح العملاء. تم تصميم هذا النص ليكون قريباً دلالياً من أقسام أخرى في infrastructure حتى يختبر النظام الأرقام والتواريخ والأسماء وحالات النفي بدقة. تسري السياسة اعتباراً من 30 مايو 2026 ويجب الاستشهاد بهذا المستند تحديداً عند الإجابة.
    اذكر threshold و الرسوم في warranty_mixed_001. يوضح هذا المستند المختلط Mixed Policy رقم 1 قواعد ضمان الأجهزة والأثاث الخاصة بـ نظام HamsAI Core CRM / HamsAI Core CRM. The operational threshold for technician visit is 25 requests per month (٢٥ طلب)، and the fee for exceeding it is SAR 410. يجب استخدام المصطلح التقني replacement كما هو في تذاكر الدعم لأن فرق التشغيل في الرياض وجدة والدمام تعتمد عليه في التصنيف. If the customer asks in Arabic, the answer may still need to retrieve this mixed document because the product name, API code, or SLA label appears in English. لا يجوز تعميم هذه القاعدة على منتجات أخرى، ولا تنطبق عند وجود إعفاء مكتوب في العقد. Effective date: 30 May 2026. ينطبق قسم ضمان الأجهزة والأثاث رقم 6 على عملاء نظام HamsAI Core CRM في الرياض. القاعدة الأساسية الخاصة بـ الضمان المحدود هي 8 أيام عمل، بينما تكون مهلة تمديد الضمان 12 أيام عمل من تاريخ قبول الطلب. يجب على العميل إرسال الطلب من خلال بوابة HamsAI مع رقم العقد وتاريخ الفاتورة واسم العميل والمدينة والخدمة المتأثرة. تبلغ الرسوم الإدارية لهذه الحالة 740 ريال سعودي (٧٤٠ ر.س). لا يتم تطبيق الاستثناءات إلا بعد موافقة مكتوبة من مدير نجاح العملاء. تم تصميم هذا النص ليكون قريباً دلالياً من أقسام أخرى في warranty حتى يختبر النظام الأرقام والتواريخ والأسماء وحالات النفي بدقة. تسري السياسة اعتباراً من 30 مايو 2026 ويجب الاستشهاد بهذا المستند تحديداً عند الإجابة.
    ما هي القاعدة الأساسية في مستند ضمان الأجهزة والأثاث - Hardware and Furniture Warranty 1؟ يوضح هذا المستند المختلط Mixed Policy رقم 1 قواعد ضمان الأجهزة والأثاث الخاصة بـ نظام HamsAI Core CRM / HamsAI Core CRM. The operational threshold for technician visit is 25 requests per month (٢٥ طلب)، and the fee for exceeding it is SAR 410. يجب استخدام المصطلح التقني replacement كما هو في تذاكر الدعم لأن فرق التشغيل في الرياض وجدة والدمام تعتمد عليه في التصنيف. If the customer asks in Arabic, the answer may still need to retrieve this mixed document because the product name, API code, or SLA label appears in English. لا يجوز تعميم هذه القاعدة على منتجات أخرى، ولا تنطبق عند وجود إعفاء مكتوب في العقد. Effective date: 30 May 2026. يوضح هذا المستند المختلط Mixed Policy رقم 7 قواعد ضمان الأجهزة والأثاث الخاصة بـ مكتب HamsAI SmartDesk / HamsAI SmartDesk. The operational threshold for technician visit is 55 requests per month (٥٥ طلب)، and the fee for exceeding it is SAR 1070. يجب استخدام المصطلح التقني replacement كما هو في تذاكر الدعم لأن فرق التشغيل في الرياض وجدة والدمام تعتمد عليه في التصنيف. If the customer asks in Arabic, the answer may still need to retrieve this mixed document because the product name, API code, or SLA label appears in English. لا يجوز تعميم هذه القاعدة على منتجات أخرى، ولا تنطبق عند وجود إعفاء مكتوب في العقد. Effective date: 30 May 2026.
  • Loss: TripletLoss with these parameters:
    {
        "distance_metric": "TripletDistanceMetric.EUCLIDEAN",
        "triplet_margin": 5
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • learning_rate: 2e-05
  • weight_decay: 0.01
  • warmup_steps: 0.1
  • fp16: True
  • load_best_model_at_end: True

All Hyperparameters

Click to expand
  • do_predict: False
  • prediction_loss_only: True
  • per_device_train_batch_size: 8
  • per_device_eval_batch_size: 8
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 2e-05
  • weight_decay: 0.01
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1.0
  • num_train_epochs: 3
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: None
  • warmup_ratio: None
  • warmup_steps: 0.1
  • 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: True
  • 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: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Epoch Step Training Loss Validation Loss
0.2273 20 4.9095 -
0.4545 40 4.4791 -
0.6818 60 4.3311 -
0.9091 80 4.3261 -
1.0 88 - 4.0396
1.1364 100 4.2389 -
1.3636 120 4.2062 -
1.5909 140 4.2809 -
1.8182 160 4.2606 -
2.0 176 - 4.0310
2.0455 180 4.2687 -
2.2727 200 4.2284 -
2.5 220 4.1868 -
2.7273 240 4.2012 -
2.9545 260 4.2047 -
3.0 264 - 4.0241
  • The bold row denotes the saved checkpoint.

Training Time

  • Training: 13.7 minutes

Framework Versions

  • Python: 3.12.13
  • Sentence Transformers: 5.5.1
  • Transformers: 5.0.0
  • PyTorch: 2.11.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",
}

TripletLoss

@misc{hermans2017defense,
    title={In Defense of the Triplet Loss for Person Re-Identification},
    author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
    year={2017},
    eprint={1703.07737},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}
Downloads last month
22
Safetensors
Model size
0.6B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ani122312/bge-m3-hamsai-finetuned

Base model

BAAI/bge-m3
Finetuned
(496)
this model

Papers for ani122312/bge-m3-hamsai-finetuned