CoolFace
Modelpublic

pankajrajdeo/UMLS-ED-Bioformer-8L-V-1

sourceHugging Faceupdated 2y agoView on Hugging Face
1likes82downloads
Model Card

SentenceTransformer

This is a sentence-transformers model trained. It maps sentences & paragraphs to a 512-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: Unknown -->
  • —Maximum Sequence Length: 512 tokens
  • —Output Dimensionality: 512 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: BertModel 
  (1): Pooling({'word_embedding_dimension': 512, '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("pankajrajdeo/328500_bioformer_8L")
# Run inference
sentences = [
    'vägtrafikolyckor',
    'accidente vial',
    'trimeresurus andersoni',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 512]

# 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: 9,358,675 training samples
  • —Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
  • —Approximate statistics based on the first 1000 samples: | | anchor | positive | negative | |:--------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | string | | details | <ul><li>min: 6 tokens</li><li>mean: 12.84 tokens</li><li>max: 23 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 15.45 tokens</li><li>max: 187 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 14.75 tokens</li><li>max: 91 tokens</li></ul> |
  • —Samples: | anchor | positive | negative | |:--------------------------------------------|:-------------------------------------------------------------------|:------------------------------------------------| | <code>(131)i-makroaggregerat albumin</code> | <code>macroagrégats d'albumine humaine marquée à l'iode 131</code> | <code>1-acylglycerophosphorylinositol</code> | | <code>(131)i-makroaggregerat albumin</code> | <code>albumin, radio-iodinated serum</code> | <code>allo-aromadendrane-10alpha,14-diol</code> | | <code>(131)i-makroaggregerat albumin</code> | <code>serum albumin, radio iodinated</code> | <code>acquired zygomatic hyperplasia</code> |
  • —Loss: <code>TripletLoss</code> with these parameters:
json
  {
      "distance_metric": "TripletDistanceMetric.EUCLIDEAN",
      "triplet_margin": 5
  }

Evaluation Dataset

Unnamed Dataset
  • —Size: 820,102 evaluation samples
  • —Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
  • —Approximate statistics based on the first 1000 samples: | | anchor | positive | negative | |:--------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------| | type | string | string | string | | details | <ul><li>min: 3 tokens</li><li>mean: 10.54 tokens</li><li>max: 20 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 13.21 tokens</li><li>max: 183 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 14.98 tokens</li><li>max: 322 tokens</li></ul> |
  • —Samples: | anchor | positive | negative | |:-----------------------------------------|:------------------------------------------|:------------------------------------------------------| | <code>15-ketosteryloleathydrolase</code> | <code>steroid esterase, lipoidal</code> | <code>glutamic acid-lysine-tyrosine terpolymer</code> | | <code>15-ketosteryloleathydrolase</code> | <code>hydrolase, cholesterol ester</code> | <code>unionicola parvipora</code> | | <code>15-ketosteryloleathydrolase</code> | <code>acylhydrolase, sterol ester</code> | <code>mayamaea fossalis var. fossalis</code> |
  • —Loss: <code>TripletLoss</code> with these parameters:
json
  {
      "distance_metric": "TripletDistanceMetric.EUCLIDEAN",
      "triplet_margin": 5
  }

Training Hyperparameters

Non-Default Hyperparameters
  • —eval_strategy: steps
  • —per_device_train_batch_size: 128
  • —learning_rate: 2e-05
  • —num_train_epochs: 10
  • —warmup_ratio: 0.1
  • —fp16: True
  • —load_best_model_at_end: True
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: 128
  • —per_device_eval_batch_size: 8
  • —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: 10
  • —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: 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: True
  • —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
  • —use_liger_kernel: False
  • —eval_use_gather_object: False
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: proportional

</details>

Training Logs

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

EpochStepTraining Lossloss
0.013710002.6865-
0.027420001.4053-
0.041030000.9222-
0.054740000.7162-
0.068450000.6036-
0.082160000.5245-
0.095770000.4665-
0.109480000.4215-
0.123190000.3931-
0.1368100000.3661-
0.1504110000.348-
0.1641120000.3241-
0.1778130000.3108-
0.1915140000.2943-
0.2052150000.2817-
0.2188160000.2653-
0.2325170000.2562-
0.2462180000.2529-
0.2599190000.2438-
0.2735200000.2359-
0.2872210000.2237-
0.3009220000.2207-
0.3146230000.2143-
0.3283240000.2141-
0.3419250000.2024-
0.3556260000.196-
0.3693270000.1951-
0.3830280000.19-
0.3966290000.1864-
0.4103300000.1866-
0.4240310000.1797-
0.4377320000.1805-
0.4513330000.1681-
0.4650340000.1712-
0.4787350000.1698-
0.4924360000.1619-
0.499236500-0.1407
0.5061370000.1652-
0.5197380000.1622-
0.5334390000.1603-
0.5471400000.1518-
0.5608410000.1488-
0.5744420000.1531-
0.5881430000.1472-
0.6018440000.1454-
0.6155450000.1473-
0.6291460000.1411-
0.6428470000.1389-
0.6565480000.1375-
0.6702490000.1393-
0.6839500000.1366-
0.6975510000.134-
0.7112520000.1331-
0.7249530000.1323-
0.7386540000.1309-
0.7522550000.1254-
0.7659560000.1298-
0.7796570000.1244-
0.7933580000.1254-
0.8069590000.1205-
0.8206600000.1213-
0.8343610000.1226-
0.8480620000.1187-
0.8617630000.1158-
0.8753640000.1171-
0.8890650000.1137-
0.9027660000.1172-
0.9164670000.1169-
0.9300680000.1137-
0.9437690000.1145-
0.9574700000.1127-
0.9711710000.1126-
0.9848720000.1126-
0.9984730000.10780.0997
1.0121740000.0999-
1.0258750000.1001-
1.0395760000.0962-
1.0531770000.0984-
1.0668780000.0982-
1.0805790000.098-
1.0942800000.0964-
1.1078810000.0964-
1.1215820000.0949-
1.1352830000.0929-
1.1489840000.0914-
1.1626850000.0918-
1.1762860000.0916-
1.1899870000.0891-
1.2036880000.0921-
1.2173890000.0925-
1.2309900000.091-
1.2446910000.0875-
1.2583920000.0898-
1.2720930000.0856-
1.2856940000.0866-
1.2993950000.0843-
1.3130960000.0848-
1.3267970000.0872-
1.3404980000.0853-
1.3540990000.0898-
1.36771000000.0831-
1.38141010000.0819-
1.39511020000.0842-
1.40871030000.083-
1.42241040000.0824-
1.43611050000.0802-
1.44981060000.0834-
1.46341070000.0833-
1.47711080000.0815-
1.49081090000.079-
1.4976109500-0.0820
1.50451100000.0809-
1.51821110000.0784-
1.53181120000.0767-
1.54551130000.0782-
1.55921140000.0799-
1.57291150000.0787-
1.58651160000.0798-
1.60021170000.0821-
1.61391180000.0771-
1.62761190000.0758-
1.64131200000.0789-
1.65491210000.0777-
1.66861220000.0755-
1.68231230000.0774-
1.69601240000.0748-
1.70961250000.077-
1.72331260000.0755-
1.73701270000.0749-
1.75071280000.0718-
1.76431290000.0753-
1.77801300000.0728-
1.79171310000.0704-
1.80541320000.0719-
1.81911330000.0711-
1.83271340000.0713-
1.84641350000.0695-
1.86011360000.0716-
1.87381370000.0691-
1.88741380000.0692-
1.90111390000.0744-
1.91481400000.0726-
1.92851410000.0682-
1.94211420000.0695-
1.95581430000.0723-
1.96951440000.0711-
1.98321450000.0692-
1.99691460000.06940.0704
2.01051470000.0572-
2.02421480000.0545-
2.03791490000.0549-
2.05161500000.0552-
2.06521510000.0551-
2.07891520000.0559-
2.09261530000.0582-
2.10631540000.0587-
2.11991550000.0529-
2.13361560000.059-
2.14731570000.0534-
2.16101580000.0547-
2.17471590000.0543-
2.18831600000.0558-
2.20201610000.0548-
2.21571620000.0534-
2.22941630000.0548-
2.24301640000.0546-
2.25671650000.053-
2.27041660000.0557-
2.28411670000.0541-
2.29781680000.0527-
2.31141690000.0542-
2.32511700000.0529-
2.33881710000.0554-
2.35251720000.054-
2.36611730000.0506-
2.37981740000.054-
2.39351750000.0525-
2.40721760000.0542-
2.42081770000.0546-
2.43451780000.0516-
2.44821790000.053-
2.46191800000.0542-
2.47561810000.0538-
2.48921820000.0536-
2.4961182500-0.0655
2.50291830000.0489-
2.51661840000.0543-
2.53031850000.0509-
2.54391860000.0525-
2.55761870000.0525-
2.57131880000.0535-
2.58501890000.052-
2.59861900000.0524-
2.61231910000.0537-
2.62601920000.055-
2.63971930000.0501-
2.65341940000.0507-
2.66701950000.0525-
2.68071960000.0525-
2.69441970000.0524-
2.70811980000.0516-
2.72171990000.051-
2.73542000000.0533-
2.74912010000.0515-
2.76282020000.0505-
2.77642030000.0492-
2.79012040000.0536-
2.80382050000.0488-
2.81752060000.0473-
2.83122070000.0536-
2.84482080000.0499-
2.85852090000.0507-
2.87222100000.0511-
2.88592110000.0494-
2.89952120000.0508-
2.91322130000.0494-
2.92692140000.048-
2.94062150000.0494-
2.95432160000.0511-
2.96792170000.0498-
2.98162180000.0487-
2.99532190000.04860.0622
3.00902200000.0403-
3.02262210000.0353-
3.03632220000.037-
3.05002230000.0361-
3.06372240000.0386-
3.07732250000.0366-
3.09102260000.0383-
3.10472270000.0374-
3.11842280000.0389-
3.13212290000.0365-
3.14572300000.0385-
3.15942310000.037-
3.17312320000.0382-
3.18682330000.0391-
3.20042340000.0361-
3.21412350000.0369-
3.22782360000.0387-
3.24152370000.0402-
3.25512380000.0394-
3.26882390000.0377-
3.28252400000.0361-
3.29622410000.0375-
3.30992420000.0385-
3.32352430000.0384-
3.33722440000.0389-
3.35092450000.0376-
3.36462460000.0367-
3.37822470000.036-
3.39192480000.0409-
3.40562490000.0358-
3.41932500000.0384-
3.43292510000.0361-
3.44662520000.0371-
3.46032530000.0397-
3.47402540000.0393-
3.48772550000.0379-
3.4945255500-0.0609
3.50132560000.0375-
3.51502570000.0394-
3.52872580000.0392-
3.54242590000.0397-
3.55602600000.036-
3.56972610000.0368-
3.58342620000.0388-
3.59712630000.0395-
3.61082640000.0392-
3.62442650000.038-
3.63812660000.0359-
3.65182670000.0382-
3.66552680000.0371-
3.67912690000.0383-
3.69282700000.0398-
3.70652710000.0372-
3.72022720000.0382-
3.73382730000.0382-
3.74752740000.0346-
3.76122750000.0396-
3.77492760000.0366-
3.78862770000.0398-
3.80222780000.037-
3.81592790000.0376-
3.82962800000.0379-
3.84332810000.0378-
3.85692820000.0372-
3.87062830000.0394-
3.88432840000.0385-
3.89802850000.0366-
3.91162860000.0368-
3.92532870000.0365-
3.93902880000.0378-
3.95272890000.0365-
3.96642900000.0384-
3.98002910000.0376-
3.99372920000.03760.0578
4.00742930000.0314-
4.02112940000.0274-
4.03472950000.0281-
4.04842960000.0262-
4.06212970000.027-
4.07582980000.0275-
4.08942990000.0273-
4.10313000000.0265-
4.11683010000.0293-
4.13053020000.0291-
4.14423030000.0274-
4.15783040000.0268-
4.17153050000.0267-
4.18523060000.0264-
4.19893070000.0288-
4.21253080000.0284-
4.22623090000.0279-
4.23993100000.0283-
4.25363110000.0283-
4.26733120000.0308-
4.28093130000.0284-
4.29463140000.0266-
4.30833150000.0268-
4.32203160000.0272-
4.33563170000.0293-
4.34933180000.0258-
4.36303190000.0302-
4.37673200000.0272-
4.39033210000.0287-
4.40403220000.0283-
4.41773230000.0279-
4.43143240000.0284-
4.44513250000.0272-
4.45873260000.0285-
4.47243270000.028-
4.48613280000.0265-
4.4929328500-0.0567

</details>

Framework Versions

  • —Python: 3.9.16
  • —Sentence Transformers: 3.1.1
  • —Transformers: 4.45.2
  • —PyTorch: 2.4.1+cu121
  • —Accelerate: 1.0.0
  • —Datasets: 3.0.1
  • —Tokenizers: 0.20.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",
}
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. -->