CoolFace
Modelpublic

PaDaS-Lab/xlm-roberta-base-msmarco-webfaq

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes98downloads
Model Card

SentenceTransformer

This is a sentence-transformers model trained. It maps sentences & paragraphs to a 768-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: XLM-RoBERTa-base-MSMARCO
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 768 dimensions
  • Similarity Function: Cosine Similarity
  • Training Dataset: WebFAQ Retrieval Dataset <!-- - Language: Unknown -->
  • License: MIT

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: XLMRobertaModel 
  (1): Pooling({'word_embedding_dimension': 768, '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})
)

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("PaDaS-Lab/xlm-roberta-base-msmarco-webfaq")
# Run inference
sentences = [
    'Muss der Deckel der TipBox beim Autoklavieren geöffnet werden?',
    'Nein, das ist nicht notwendig. Die neue TipBox kann bei 121°C im geschlossenen Zustand autoklaviert werden.',
    'برآمدگی های بیضه ممکن است نشان دهنده مشکلی در بیضه ها باشد. ممکن است به دلیل صدمه ای به وجود آمده یا ممکن است یک مشکل پزشکی جدی باشد.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

<!--

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

<!--

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: 2,560,000 training samples
  • Columns: <code>sentence0</code> and <code>sentence1</code>
  • Approximate statistics based on the first 1000 samples: | | sentence0 | sentence1 | |:--------|:----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 6 tokens</li><li>mean: 15.02 tokens</li><li>max: 86 tokens</li></ul> | <ul><li>min: 11 tokens</li><li>mean: 66.82 tokens</li><li>max: 512 tokens</li></ul> |
  • Samples: | sentence0 | sentence1 | |:-----------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>Hat myTime ein großes Produktsortiment?</code> | <code>Das Sortiment von myTime umfasst mehr als 13.000 Lebensmittel. Du findest alle Produkte, die du auch im Supermarkt findest, darunter Obst und Gemüse, trockene Lebensmittel wie Pasta und Reis, Backwaren, Snacks und Tiefkühlkost. Auch Getränke wie Kaffee, Alkohol und Soda findest du im Online-Supermarkt.</code> | | <code>Gibt es eine Tigerspin App?</code> | <code>Tigerspin verzichtet auf eine mobile App. Wenn Sie ein paar Runden spielen möchten, öffnen Sie einfach die Webseite des Casinos und starten die Spiele im Browser.</code> | | <code>Bietet ihr auch maschinelle Übersetzungen an? Wenn ja, wann eignet sich diese und wann nicht?</code> | <code>Maschinelle Übersetzungen sind ein span­nen­des Thema, auch aktuell bei techtrans. Unter maschineller Übersetzung (MÜ) ver­steht man die auto­mati­sierte Über­tra­gung eines Aus­gangs­textes in die Ziel­sprache mittels einer so­ge­nannten Über­set­zungs­engine. Eine solche Engine kann nach re­gel­ba­sier­ten, statis­tischen oder neu­ro­nalen Prin­zipien auf­ge­baut sein.<br>Ob­wohl es maschinelle Über­set­zungs­engines schon seit einigen Jahr­zehn­ten gibt, ist erst mit der Ein­führung der neu­ro­nalen Engines (NMT) ca. ab dem Jahre 2015 die Output-Qualität ge­stie­gen. Nam­hafte Engine Provider sind zum Bei­spiel Google, DeepL, Microsoft, Amazon AWS und SDL. So ist es kaum ver­wunder­lich, dass diese Tech­no­logie zu­neh­mend Ein­zug sowohl in unseren All­tag als auch in den Über­set­zungs­pro­zess findet.</code> |
  • Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim"
  }

Training Hyperparameters

Non-Default Hyperparameters
  • per_device_train_batch_size: 128
  • per_device_eval_batch_size: 128
  • num_train_epochs: 1
  • fp16: True
  • multi_dataset_batch_sampler: round_robin
All Hyperparameters

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

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: no
  • prediction_loss_only: True
  • per_device_train_batch_size: 128
  • per_device_eval_batch_size: 128
  • 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: 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: {}
  • warmup_ratio: 0.0
  • 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: False
  • fp16: True
  • 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}
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch
  • 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
  • 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
  • dispatch_batches: None
  • split_batches: 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
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin

</details>

Training Logs

EpochStepTraining Loss
0.0255000.1999
0.0510000.0279
0.07515000.0234
0.120000.0203
0.12525000.0179
0.1530000.0171
0.17535000.0153
0.240000.015
0.22545000.0143
0.2550000.014
0.27555000.0128
0.360000.013
0.32565000.0129
0.3570000.0124
0.37575000.012
0.480000.0121
0.42585000.0115
0.4590000.0113
0.47595000.0106
0.5100000.0107
0.525105000.011
0.55110000.0108
0.575115000.0103
0.6120000.0097
0.625125000.01
0.65130000.0104
0.675135000.0096
0.7140000.0096
0.725145000.0097
0.75150000.0097
0.775155000.0089
0.8160000.0089
0.825165000.0091
0.85170000.0085
0.875175000.0084
0.9180000.0089
0.925185000.0087
0.95190000.0087
0.975195000.0088
1.0200000.0089

Framework Versions

  • Python: 3.11.5
  • Sentence Transformers: 3.4.0
  • Transformers: 4.48.0
  • PyTorch: 2.5.1+cu124
  • Accelerate: 1.2.1
  • Datasets: 2.21.0
  • Tokenizers: 0.21.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}
}
WebFAQ Dataset
bibtex
@misc{dinzinger2025webfaq,
    title={WebFAQ: A Multilingual Collection of Natural Q&amp;A Datasets for Dense Retrieval},
    author={Michael Dinzinger and Laura Caspari and Kanishka Ghosh Dastidar and Jelena Mitrović and Michael Granitzer},
    year={2025},
    eprint={2502.20936},
    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. -->