---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dense
- generated_from_trainer
- dataset_size:852480
- loss:MultipleNegativesRankingLoss
base_model: sentence-transformers/all-mpnet-base-v2
widget:
- source_sentence: anal ectopia
sentences:
- Acute Chagas disease without heart involvement
- Ectopic anus
- chronic inactive rheumatic heart disease
- source_sentence: lactose intolerance
sentences:
- infectious granulomas of the central nervous system, site unspecified
- lm - [lactose malabsorption]
- monoblastic leukaemia
- source_sentence: syndromes with eye anomalies as a major feature
sentences:
- Syndromes with eye anomalies as a major feature
- abnormality of nail surface
- dermatomyositis
- source_sentence: dibothriocephalus latus
sentences:
- dibothriocephaliasis
- postprocedural pelvic peritoneal adhesions
- saccadic pulse-step mismatch
- source_sentence: indeterminate cell histiocytosis
sentences:
- other specified progressive focal atrophies
- fetal nephrocalcinosis
- Indeterminate cell histiocytosis
pipeline_tag: sentence-similarity
library_name: sentence-transformers
---
# SentenceTransformer based on sentence-transformers/all-mpnet-base-v2
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-mpnet-base-v2). It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, classification, clustering, and more.
## Model Details
### Model Description
- **Model Type:** Sentence Transformer
- **Base model:** [sentence-transformers/all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-mpnet-base-v2)
- **Maximum Sequence Length:** 32 tokens
- **Output Dimensionality:** 768 dimensions
- **Similarity Function:** Cosine Similarity
- **Supported Modality:** Text
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
### Full Model Architecture
```
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'MPNetModel'})
(1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'mean', 'include_prompt': True})
(2): Normalize({})
)
```
## 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("seanfarrell/icd11_synonym_model")
# Run inference
sentences = [
'indeterminate cell histiocytosis',
'Indeterminate cell histiocytosis',
'fetal nephrocalcinosis',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 1.0000, 0.0856],
# [1.0000, 1.0000, 0.0856],
# [0.0856, 0.0856, 1.0000]])
```
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 852,480 training samples
* Columns: anchor and positive
* Approximate statistics based on the first 100 samples:
| | anchor | positive |
|:---------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string |
| modality | text | text |
| details |
fracture, dislocation or subluxation of spine due to birth injury | Fracture, dislocation or subluxation of spine due to birth injury |
| malignant neoplasms of bladder | Malignant neoplasms of bladder |
| Toxic shock syndrome due to other specified infectious agent | toxic shock syndrome due to other specified infectious agent |
* Loss: [MultipleNegativesRankingLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "cos_sim",
"gather_across_devices": false,
"directions": [
"query_to_doc"
],
"partition_mode": "joint",
"hardness_mode": null,
"hardness_strength": 0.0
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 512
- `num_train_epochs`: 1
- `learning_rate`: 2e-05
- `lr_scheduler_type`: cosine
- `warmup_steps`: 166
- `weight_decay`: 0.01
- `bf16`: True
- `per_device_eval_batch_size`: 256
- `dataloader_drop_last`: True
- `dataloader_num_workers`: 4
#### All Hyperparameters