metadata
base_model: allenai/specter2_base
library_name: sentence-transformers
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:9988
- loss:MultipleNegativesRankingLoss
widget:
- source_sentence: Splenomegaly in Malta fever
sentences:
- 'TROPICAL SPLENOMEGALY. '
- >-
[Voluminous migrating spleen in the course of Malta fever: effects of
splenectomy].
- '[Adenoma of appendix]. '
- source_sentence: sRNA regulation
sentences:
- 'SR proteins control a complex network of RNA-processing events. '
- >-
Convergence of submodality-specific input onto neurons in primary
somatosensory cortex.
- 'Dynamic features of gene expression control by small regulatory RNAs. '
- source_sentence: Foley catheter hysterosalpingography
sentences:
- 'Hysterosalpingography using a Foley catheter. '
- >-
[Long-term follow-up of adult patients with isolated congenital AV
block].
- 'Hysterosalpingography. '
- source_sentence: Anti-endoglin monoclonal antibodies
sentences:
- >-
Cortisol response to general anaesthesia for medical imaging in
children.
- >-
Anti-endoglin monoclonal antibodies are effective for suppressing
metastasis and the primary tumors by targeting tumor vasculature.
- 'Endoglin: Beyond the Endothelium. '
- source_sentence: Alternariol Methyl Ether Quantitation
sentences:
- >-
Stable isotope dilution assays of alternariol and alternariol monomethyl
ether in beverages.
- >-
The roles of eotaxin and the STAT6 signalling pathway in eosinophil
recruitment and host resistance to the nematodes Nippostrongylus
brasiliensis and Heligmosomoides bakeri.
- >-
Mechanisms of Action and Toxicity of the Mycotoxin Alternariol: A
Review.
SentenceTransformer based on allenai/specter2_base
This is a sentence-transformers model finetuned from allenai/specter2_base on the json dataset. 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: allenai/specter2_base
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 768 tokens
- Similarity Function: Cosine Similarity
- Training Dataset:
- json
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
(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:
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 = [
'Alternariol Methyl Ether Quantitation',
'Stable isotope dilution assays of alternariol and alternariol monomethyl ether in beverages. ',
'Mechanisms of Action and Toxicity of the Mycotoxin Alternariol: A Review. ',
]
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]
Training Details
Training Dataset
json
- Dataset: json
- Size: 9,988 training samples
- Columns:
anchor
,positive
, andnegative
- Approximate statistics based on the first 1000 samples:
anchor positive negative type string string string details - min: 4 tokens
- mean: 7.66 tokens
- max: 34 tokens
- min: 6 tokens
- mean: 19.05 tokens
- max: 42 tokens
- min: 4 tokens
- mean: 11.84 tokens
- max: 48 tokens
- Samples:
anchor positive negative mechanotransduction pathways
Signalling cascades in mechanotransduction: cell-matrix interactions and mechanical loading.
Mechanotransduction: May the force be with you.
FSR-tunable comb filter
Multiwavelength Raman fiber laser with a continuously-tunable spacing.
Tunable multiwavelength fiber laser using a comb filter based on erbium-ytterbium co-doped polarization maintaining fiber loop mirror.
Radiation pneumonitis enhancement
Induction and concurrent taxanes enhance both the pulmonary metabolic radiation response and the radiation pneumonitis response in patients with esophagus cancer.
Imaging of Hypersensitivity Pneumonitis.
- Loss:
MultipleNegativesRankingLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size
: 32per_device_eval_batch_size
: 32learning_rate
: 2e-05num_train_epochs
: 1lr_scheduler_type
: cosine_with_restartswarmup_ratio
: 0.1bf16
: Truebatch_sampler
: no_duplicates
All Hyperparameters
Click to expand
overwrite_output_dir
: Falsedo_predict
: Falseeval_strategy
: noprediction_loss_only
: Trueper_device_train_batch_size
: 32per_device_eval_batch_size
: 32per_gpu_train_batch_size
: Noneper_gpu_eval_batch_size
: Nonegradient_accumulation_steps
: 1eval_accumulation_steps
: Nonetorch_empty_cache_steps
: Nonelearning_rate
: 2e-05weight_decay
: 0.0adam_beta1
: 0.9adam_beta2
: 0.999adam_epsilon
: 1e-08max_grad_norm
: 1.0num_train_epochs
: 1max_steps
: -1lr_scheduler_type
: cosine_with_restartslr_scheduler_kwargs
: {}warmup_ratio
: 0.1warmup_steps
: 0log_level
: passivelog_level_replica
: warninglog_on_each_node
: Truelogging_nan_inf_filter
: Truesave_safetensors
: Truesave_on_each_node
: Falsesave_only_model
: Falserestore_callback_states_from_checkpoint
: Falseno_cuda
: Falseuse_cpu
: Falseuse_mps_device
: Falseseed
: 42data_seed
: Nonejit_mode_eval
: Falseuse_ipex
: Falsebf16
: Truefp16
: Falsefp16_opt_level
: O1half_precision_backend
: autobf16_full_eval
: Falsefp16_full_eval
: Falsetf32
: Nonelocal_rank
: 0ddp_backend
: Nonetpu_num_cores
: Nonetpu_metrics_debug
: Falsedebug
: []dataloader_drop_last
: Falsedataloader_num_workers
: 0dataloader_prefetch_factor
: Nonepast_index
: -1disable_tqdm
: Falseremove_unused_columns
: Truelabel_names
: Noneload_best_model_at_end
: Falseignore_data_skip
: Falsefsdp
: []fsdp_min_num_params
: 0fsdp_config
: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap
: Noneaccelerator_config
: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed
: Nonelabel_smoothing_factor
: 0.0optim
: adamw_torchoptim_args
: Noneadafactor
: Falsegroup_by_length
: Falselength_column_name
: lengthddp_find_unused_parameters
: Noneddp_bucket_cap_mb
: Noneddp_broadcast_buffers
: Falsedataloader_pin_memory
: Truedataloader_persistent_workers
: Falseskip_memory_metrics
: Trueuse_legacy_prediction_loop
: Falsepush_to_hub
: Falseresume_from_checkpoint
: Nonehub_model_id
: Nonehub_strategy
: every_savehub_private_repo
: Falsehub_always_push
: Falsegradient_checkpointing
: Falsegradient_checkpointing_kwargs
: Noneinclude_inputs_for_metrics
: Falseeval_do_concat_batches
: Truefp16_backend
: autopush_to_hub_model_id
: Nonepush_to_hub_organization
: Nonemp_parameters
:auto_find_batch_size
: Falsefull_determinism
: Falsetorchdynamo
: Noneray_scope
: lastddp_timeout
: 1800torch_compile
: Falsetorch_compile_backend
: Nonetorch_compile_mode
: Nonedispatch_batches
: Nonesplit_batches
: Noneinclude_tokens_per_second
: Falseinclude_num_input_tokens_seen
: Falseneftune_noise_alpha
: Noneoptim_target_modules
: Nonebatch_eval_metrics
: Falseeval_on_start
: Falseuse_liger_kernel
: Falseeval_use_gather_object
: Falsebatch_sampler
: no_duplicatesmulti_dataset_batch_sampler
: proportional
Training Logs
Click to expand
Epoch | Step | Training Loss |
---|---|---|
0.0095 | 1 | 2.9432 |
0.0190 | 2 | 3.0121 |
0.0286 | 3 | 2.9051 |
0.0381 | 4 | 2.7906 |
0.0476 | 5 | 2.6592 |
0.0571 | 6 | 2.2835 |
0.0667 | 7 | 2.1373 |
0.0762 | 8 | 1.7872 |
0.0857 | 9 | 1.6329 |
0.0952 | 10 | 1.5184 |
0.1048 | 11 | 1.234 |
0.1143 | 12 | 1.0315 |
0.1238 | 13 | 0.9664 |
0.1333 | 14 | 0.9369 |
0.1429 | 15 | 0.6871 |
0.1524 | 16 | 0.5633 |
0.1619 | 17 | 0.5141 |
0.1714 | 18 | 0.5259 |
0.1810 | 19 | 0.4295 |
0.1905 | 20 | 0.4585 |
0.2 | 21 | 0.2799 |
0.2095 | 22 | 0.4226 |
0.2190 | 23 | 0.2524 |
0.2286 | 24 | 0.2135 |
0.2381 | 25 | 0.1958 |
0.2476 | 26 | 0.1823 |
0.2571 | 27 | 0.393 |
0.2667 | 28 | 0.3186 |
0.2762 | 29 | 0.1414 |
0.2857 | 30 | 0.1927 |
0.2952 | 31 | 0.2597 |
0.3048 | 32 | 0.1291 |
0.3143 | 33 | 0.1488 |
0.3238 | 34 | 0.1203 |
0.3333 | 35 | 0.2001 |
0.3429 | 36 | 0.1877 |
0.3524 | 37 | 0.0713 |
0.3619 | 38 | 0.1778 |
0.3714 | 39 | 0.1179 |
0.3810 | 40 | 0.147 |
0.3905 | 41 | 0.1158 |
0.4 | 42 | 0.1003 |
0.4095 | 43 | 0.158 |
0.4190 | 44 | 0.159 |
0.4286 | 45 | 0.063 |
0.4381 | 46 | 0.1309 |
0.4476 | 47 | 0.0327 |
0.4571 | 48 | 0.1665 |
0.4667 | 49 | 0.1064 |
0.4762 | 50 | 0.0699 |
0.4857 | 51 | 0.0674 |
0.4952 | 52 | 0.0508 |
0.5048 | 53 | 0.0493 |
0.5143 | 54 | 0.0565 |
0.5238 | 55 | 0.0366 |
0.5333 | 56 | 0.0606 |
0.5429 | 57 | 0.0727 |
0.5524 | 58 | 0.092 |
0.5619 | 59 | 0.0628 |
0.5714 | 60 | 0.0369 |
0.5810 | 61 | 0.0889 |
0.5905 | 62 | 0.0409 |
0.6 | 63 | 0.0545 |
0.6095 | 64 | 0.0856 |
0.6190 | 65 | 0.0478 |
0.6286 | 66 | 0.0584 |
0.6381 | 67 | 0.0757 |
0.6476 | 68 | 0.0609 |
0.6571 | 69 | 0.0381 |
0.6667 | 70 | 0.069 |
0.6762 | 71 | 0.0243 |
0.6857 | 72 | 0.0517 |
0.6952 | 73 | 0.0332 |
0.7048 | 74 | 0.0662 |
0.7143 | 75 | 0.0753 |
0.7238 | 76 | 0.0914 |
0.7333 | 77 | 0.1094 |
0.7429 | 78 | 0.0557 |
0.7524 | 79 | 0.0436 |
0.7619 | 80 | 0.0137 |
0.7714 | 81 | 0.0399 |
0.7810 | 82 | 0.0278 |
0.7905 | 83 | 0.0438 |
0.8 | 84 | 0.1392 |
0.8095 | 85 | 0.0299 |
0.8190 | 86 | 0.0667 |
0.8286 | 87 | 0.0404 |
0.8381 | 88 | 0.0166 |
0.8476 | 89 | 0.1679 |
0.8571 | 90 | 0.0282 |
0.8667 | 91 | 0.0628 |
0.8762 | 92 | 0.0618 |
0.8857 | 93 | 0.0167 |
0.8952 | 94 | 0.2108 |
0.9048 | 95 | 0.0749 |
0.9143 | 96 | 0.0997 |
0.9238 | 97 | 0.0675 |
0.9333 | 98 | 0.0409 |
0.9429 | 99 | 0.0355 |
0.9524 | 100 | 0.1391 |
0.9619 | 101 | 0.0938 |
0.9714 | 102 | 0.0526 |
0.9810 | 103 | 0.0035 |
0.9905 | 104 | 0.0022 |
1.0 | 105 | 0.0016 |
Framework Versions
- Python: 3.9.19
- Sentence Transformers: 3.1.1
- Transformers: 4.45.2
- PyTorch: 2.5.0
- Accelerate: 1.0.1
- Datasets: 2.19.0
- Tokenizers: 0.20.3
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{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}
}