---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:57306
- loss:MultipleNegativesRankingLoss
base_model: allenai/specter2_base
widget:
- source_sentence: UCLR RTS timing
sentences:
- 'Timing without a timer. '
- 'Global structural changes in annexin 12. The roles of phospholipid, Ca2+, and
pH. '
- 'Length of time between surgery and return to sport after ulnar collateral ligament
reconstruction in Major League Baseball pitchers does not predict need for revision
surgery. '
- source_sentence: Levofloxacin efficacy in bone and joint infections
sentences:
- 'Levofloxacin. '
- 'Squamous cell carcinoma of the uterine cervix producing granulocyte colony-stimulating
factor: a report of 4 cases and a review of the literature. '
- 'Levofloxacin at the usual dosage to treat bone and joint infections: a cohort
analysis. '
- source_sentence: Electrical impedance tomography in Barrett's oesophagus
sentences:
- 'Barrett''s oesophagus: epidemiology, diagnosis and clinical management. '
- 'Assessing the conditions for in vivo electrical virtual biopsies in Barrett''s
oesophagus. '
- 'Serum aminoterminal propeptide of type III procollagen: a potential predictor
of the response to growth hormone therapy. '
- source_sentence: Population Aging Theory
sentences:
- 'A cybernetic theory of aging. '
- '[In process]. '
- 'Robine and Michel''s "Looking forward to a general theory on population aging":
commentary. '
- source_sentence: Algesimetric study of hypoalgesic effect
sentences:
- 'Regulation of ATG4B stability by RNF5 limits basal levels of autophagy and influences
susceptibility to bacterial infection. '
- '[Pain analysis is basis for correct choice of therapeutic method]. '
- '[Experimental algesimetric study of the hypoalgesic effect of body acupuncture]. '
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- cosine_accuracy@1
- cosine_accuracy@3
- cosine_accuracy@5
- cosine_accuracy@10
- cosine_precision@1
- cosine_precision@3
- cosine_precision@5
- cosine_precision@10
- cosine_recall@1
- cosine_recall@3
- cosine_recall@5
- cosine_recall@10
- cosine_ndcg@10
- cosine_mrr@10
- cosine_map@100
model-index:
- name: SentenceTransformer based on allenai/specter2_base
results:
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: NanoNQ
type: NanoNQ
metrics:
- type: cosine_accuracy@1
value: 0.02
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.06
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.08
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.22
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.02
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.02
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.016
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.022000000000000002
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.01
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.05
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.07
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.19
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.08358031930860417
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.060047619047619044
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.05702682179889267
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: NanoMSMARCO
type: NanoMSMARCO
metrics:
- type: cosine_accuracy@1
value: 0.12
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.3
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.34
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.44
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.12
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.1
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.068
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.044000000000000004
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.12
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.3
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.34
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.44
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.2718119392465092
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.21891269841269842
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.22988006901512154
name: Cosine Map@100
- task:
type: nano-beir
name: Nano BEIR
dataset:
name: NanoBEIR mean
type: NanoBEIR_mean
metrics:
- type: cosine_accuracy@1
value: 0.06999999999999999
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.18
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.21000000000000002
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.33
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.06999999999999999
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.060000000000000005
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.042
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.033
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.065
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.175
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.20500000000000002
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.315
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.17769612927755668
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.13948015873015873
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.1434534454070071
name: Cosine Map@100
---
# SentenceTransformer based on allenai/specter2_base
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [allenai/specter2_base](https://huggingface.co/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](https://huggingface.co/allenai/specter2_base)
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 768 dimensions
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
- json
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
### 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:
```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("sentence_transformers_model_id")
# Run inference
sentences = [
'Algesimetric study of hypoalgesic effect',
'[Experimental algesimetric study of the hypoalgesic effect of body acupuncture]. ',
'[Pain analysis is basis for correct choice of therapeutic method]. ',
]
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]
```
## Evaluation
### Metrics
#### Information Retrieval
* Datasets: `NanoNQ` and `NanoMSMARCO`
* Evaluated with [InformationRetrievalEvaluator](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
| Metric | NanoNQ | NanoMSMARCO |
|:--------------------|:-----------|:------------|
| cosine_accuracy@1 | 0.02 | 0.12 |
| cosine_accuracy@3 | 0.06 | 0.3 |
| cosine_accuracy@5 | 0.08 | 0.34 |
| cosine_accuracy@10 | 0.22 | 0.44 |
| cosine_precision@1 | 0.02 | 0.12 |
| cosine_precision@3 | 0.02 | 0.1 |
| cosine_precision@5 | 0.016 | 0.068 |
| cosine_precision@10 | 0.022 | 0.044 |
| cosine_recall@1 | 0.01 | 0.12 |
| cosine_recall@3 | 0.05 | 0.3 |
| cosine_recall@5 | 0.07 | 0.34 |
| cosine_recall@10 | 0.19 | 0.44 |
| **cosine_ndcg@10** | **0.0836** | **0.2718** |
| cosine_mrr@10 | 0.06 | 0.2189 |
| cosine_map@100 | 0.057 | 0.2299 |
#### Nano BEIR
* Dataset: `NanoBEIR_mean`
* Evaluated with [NanoBEIREvaluator](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.NanoBEIREvaluator)
| Metric | Value |
|:--------------------|:-----------|
| cosine_accuracy@1 | 0.07 |
| cosine_accuracy@3 | 0.18 |
| cosine_accuracy@5 | 0.21 |
| cosine_accuracy@10 | 0.33 |
| cosine_precision@1 | 0.07 |
| cosine_precision@3 | 0.06 |
| cosine_precision@5 | 0.042 |
| cosine_precision@10 | 0.033 |
| cosine_recall@1 | 0.065 |
| cosine_recall@3 | 0.175 |
| cosine_recall@5 | 0.205 |
| cosine_recall@10 | 0.315 |
| **cosine_ndcg@10** | **0.1777** |
| cosine_mrr@10 | 0.1395 |
| cosine_map@100 | 0.1435 |
## Training Details
### Training Dataset
#### json
* Dataset: json
* Size: 57,306 training samples
* Columns: anchor, positive, and negative
* Approximate statistics based on the first 1000 samples:
| | anchor | positive | negative |
|:--------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string | string |
| details |
Intramedullary Hemangioblastoma | Hydrocephalus: a rare initial manifestation of sporadic intramedullary hemangioblastoma : Intramedullary hemangioblastoma presenting as hydrocephalus. | Intramedullary capillary haemangioma. |
| Density-based load estimation algorithm | A contact algorithm for density-based load estimation. | Density propagation based adaptive multi-density clustering algorithm. |
| Herbicide Adjuvant Efficacy | The efficiency of adjuvants combined with flupyrsulfuron-methyl plus metsulfuron-methyl (Lexus XPE) on weed control. | Are herbicides a once in a century method of weed control? |
* Loss: [MultipleNegativesRankingLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "cos_sim"
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 64
- `per_device_eval_batch_size`: 64
- `gradient_accumulation_steps`: 4
- `learning_rate`: 2e-07
- `num_train_epochs`: 1
- `lr_scheduler_type`: cosine_with_restarts
- `warmup_ratio`: 0.1
- `bf16`: True
- `batch_sampler`: no_duplicates
#### All Hyperparameters