CoolFace
Modelpublic

manuel-couto-pintos/roberta_erisk_sts

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes15downloads
Model Card

SentenceTransformer based on manuel-couto-pintos/roberta_erisk

This is a sentence-transformers model finetuned from manuel-couto-pintos/roberta_erisk. 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: manuel-couto-pintos/roberta_erisk <!-- at revision 9aa8180ee595fe69a8d23c06dc5ee405f4f5d5ac -->
  • —Maximum Sequence Length: 512 tokens
  • —Output Dimensionality: 768 tokens
  • —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}) with Transformer model: RobertaModel 
  (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("manuel-couto-pintos/roberta_erisk_sts")
# Run inference
sentences = [
    'Which is the best affiliate program?',
    'What are the best affiliate programs?',
    'What are the best affiliate networks in the UK?',
]
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: 50,881 training samples
  • —Columns: <code>sentence0</code>, <code>sentence1</code>, and <code>sentence_2</code>
  • —Approximate statistics based on the first 1000 samples: | | sentence0 | sentence1 | sentence_2 | |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | string | | details | <ul><li>min: 6 tokens</li><li>mean: 13.77 tokens</li><li>max: 42 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 13.82 tokens</li><li>max: 57 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 14.96 tokens</li><li>max: 59 tokens</li></ul> |
  • —Samples: | sentence0 | sentence1 | sentence_2 | |:---------------------------------------------------------------|:--------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------| | <code>What is a good definition of Quora?</code> | <code>What is the best definition of Quora?</code> | <code>What is Quora address?</code> | | <code>How can I make myself appear offline on facebook?</code> | <code>How do you make sure to appear as offline on Facebook?</code> | <code>How can I get Facebook to remember to keep chat offline?</code> | | <code>How do I gain some healthy weight?</code> | <code>What is the best way for underweight to gain weight?</code> | <code>My boyfriend doesn't eat a lot. What are some ways to help him gain weight fast? He's 5'7 120lbs</code> |
  • —Loss: <code>TripletLoss</code> with these parameters:
json
  {
      "distance_metric": "TripletDistanceMetric.EUCLIDEAN",
      "triplet_margin": 5
  }

Training Hyperparameters

Non-Default Hyperparameters
  • —per_device_train_batch_size: 10
  • —per_device_eval_batch_size: 10
  • —num_train_epochs: 10
  • —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: 10
  • —per_device_eval_batch_size: 10
  • —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: 10
  • —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: 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}
  • —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: False
  • —hub_always_push: False
  • —gradient_checkpointing: False
  • —gradient_checkpointing_kwargs: None
  • —include_inputs_for_metrics: False
  • —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
  • —eval_use_gather_object: False
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: round_robin

</details>

Training Logs

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

EpochStepTraining Loss
0.09835004.3807
0.196510002.5872
0.294815001.7484
0.393020001.2649
0.491325001.0219
0.589530000.8703
0.687835000.771
0.786040000.655
0.884345000.6547
0.982550000.5772
1.080855000.5628
1.179060000.5163
1.277365000.4871
1.375570000.4842
1.473875000.4316
1.572080000.4199
1.670385000.3554
1.768590000.3467
1.866895000.3591
1.9650100000.3356
2.0633105000.3281
2.1615110000.3149
2.2598115000.2767
2.3580120000.2849
2.4563125000.244
2.5545130000.2416
2.6528135000.2008
2.7510140000.1718
2.8493145000.188
2.9475150000.1656
3.0458155000.1522
3.1440160000.144
3.2423165000.1329
3.3405170000.1431
3.4388175000.128
3.5370180000.1251
3.6353185000.0921
3.7335190000.0882
3.8318195000.1087
3.9300200000.0819
4.0283205000.0916
4.1265210000.0837
4.2248215000.0855
4.3230220000.0727
4.4213225000.0772
4.5196230000.0676
4.6178235000.0597
4.7161240000.0555
4.8143245000.0613
4.9126250000.0589
5.0108255000.0503
5.1091260000.0546
5.2073265000.0446
5.3056270000.0591
5.4038275000.0431
5.5021280000.0402
5.6003285000.0354
5.6986290000.0405
5.7968295000.0308
5.8951300000.0363
5.9933305000.0365
6.0916310000.0333
6.1898315000.0238
6.2881320000.0372
6.3863325000.0331
6.4846330000.0253
6.5828335000.0315
6.6811340000.0193
6.7793345000.0239
6.8776350000.0201
6.9758355000.0213
7.0741360000.0187
7.1723365000.0125
7.2706370000.0151
7.3688375000.0208
7.4671380000.0101
7.5653385000.0191
7.6636390000.0125
7.7618395000.0136
7.8601400000.0135
7.9583405000.0118
8.0566410000.012
8.1548415000.0079
8.2531420000.0105
8.3513425000.0094
8.4496430000.0079
8.5478435000.0118
8.6461440000.0105
8.7444445000.0058
8.8426450000.013
8.9409455000.0065
9.0391460000.0089
9.1374465000.0031
9.2356470000.008
9.3339475000.0065
9.4321480000.0052
9.5304485000.0066
9.6286490000.0039
9.7269495000.004
9.8251500000.0051
9.9234505000.003

</details>

Framework Versions

  • —Python: 3.10.14
  • —Sentence Transformers: 3.0.1
  • —Transformers: 4.44.2
  • —PyTorch: 2.0.1+cu117
  • —Accelerate: 0.32.0
  • —Datasets: 2.20.0
  • —Tokenizers: 0.19.1

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",
}
TripletLoss
bibtex
@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}
}

<!--

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

manuel-couto-pintos/roberta_erisk_sts · CoolFace