---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:473546
- loss:MultipleNegativesRankingLoss
base_model: NeuML/pubmedbert-base-embeddings
widget:
- source_sentence: Lantus
sentences:
- Corrosion of first degree of unspecified hand, unspecified site, subsequent encounter
- Anencephaly
- Type 2 diabetes mellitus with diabetic peripheral angiopathy without gangrene
- Type 2 diabetes mellitus with diabetic cataract
- Type 2 diabetes mellitus with diabetic autonomic (poly)neuropathy
- Crushed by nonvenomous snake, initial encounter
- Type 2 diabetes mellitus with diabetic mononeuropathy
- Type 2 diabetes mellitus with diabetic chronic kidney disease
- Encounter for attention to other artificial openings
- Fracture of base of skull, left side, subsequent encounter for fracture with delayed
healing
- Type 2 diabetes mellitus with ketoacidosis without coma
- source_sentence: Follicular thyroid carcinoma
sentences:
- Unspecified fracture of lower end of unspecified ulna, subsequent encounter for
open fracture type I or II with nonunion
- Neoplasm of unspecified behavior of digestive system
- Unspecified fracture of T9-T10 vertebra, subsequent encounter for fracture with
nonunion
- Other benign neuroendocrine tumors
- Malignant poorly differentiated neuroendocrine tumors
- Malignant neoplasm of pyriform sinus
- Malignant neoplasm of trachea
- Poisoning by iminostilbenes, assault, sequela
- Stress fracture, unspecified foot, subsequent encounter for fracture with delayed
healing
- Adverse effect of other parasympathomimetics [cholinergics], initial encounter
- Malignant neoplasm of thyroid gland
- source_sentence: Cardiac ischemia
sentences:
- Displaced fracture of middle phalanx of other finger, subsequent encounter for
fracture with delayed healing
- Unspecified displaced fracture of surgical neck of left humerus, subsequent encounter
for fracture with routine healing
- Nondisplaced Maisonneuve's fracture of left leg, subsequent encounter for open
fracture type I or II with routine healing
- Partial traumatic amputation at right shoulder joint, initial encounter
- Toxic effect of unspecified noxious substance eaten as food, undetermined, initial
encounter
- Corrosion of third degree of left toe(s) (nail), sequela
- Atherosclerotic heart disease of native coronary artery with unstable angina pectoris
- Other specified injury of axillary artery, left side, sequela
- Hemiplegia and hemiparesis following nontraumatic subarachnoid hemorrhage affecting
left dominant side
- Displaced transverse fracture of shaft of unspecified femur
- Partial traumatic transmetacarpal amputation of unspecified hand, sequela
- source_sentence: Intrauterine fetal death
sentences:
- Dislocation of other parts of lumbar spine and pelvis, sequela
- Poisoning by cardiac-stimulant glycosides and drugs of similar action, intentional
self-harm, sequela
- Insect bite (nonvenomous) of unspecified finger, sequela
- Other diseases of the blood and blood-forming organs and certain disorders involving
the immune mechanism complicating the puerperium
- Other specified diseases and conditions complicating pregnancy, childbirth and
the puerperium
- Diseases of the respiratory system complicating childbirth
- Diseases of the circulatory system complicating childbirth
- Diseases of the skin and subcutaneous tissue complicating childbirth
- War operations involving other forms of conventional warfare, civilian, sequela
- External constriction of vagina and vulva
- Anemia complicating childbirth
- source_sentence: CAD
sentences:
- Dislocation of C6/C7 cervical vertebrae, subsequent encounter
- Unspecified injury of extensor muscle, fascia and tendon of left little finger
at wrist and hand level, subsequent encounter
- Other fracture of lower end of left tibia, subsequent encounter for closed fracture
with malunion
- Other fracture of upper end of unspecified radius, subsequent encounter for closed
fracture with delayed healing
- Poisoning by monoamine-oxidase-inhibitor antidepressants, undetermined, subsequent
encounter
- Atherosclerotic heart disease of native coronary artery with unspecified angina
pectoris
- Sprain of anterior cruciate ligament of right knee, initial encounter
- Myopia, bilateral
- Velamentous insertion of umbilical cord, first trimester
- Iliofemoral ligament sprain of left hip, subsequent encounter
- Air embolism (traumatic), sequela
datasets:
- FrancescoBuda/mimic10-hard-negatives
pipeline_tag: sentence-similarity
library_name: sentence-transformers
---
# SentenceTransformer based on NeuML/pubmedbert-base-embeddings
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [NeuML/pubmedbert-base-embeddings](https://huggingface.co/NeuML/pubmedbert-base-embeddings) on the [mimic10-hard-negatives](https://huggingface.co/datasets/FrancescoBuda/mimic10-hard-negatives) 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:** [NeuML/pubmedbert-base-embeddings](https://huggingface.co/NeuML/pubmedbert-base-embeddings)
- **Maximum Sequence Length:** 64 tokens
- **Output Dimensionality:** 768 tokens
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
- [mimic10-hard-negatives](https://huggingface.co/datasets/FrancescoBuda/mimic10-hard-negatives)
### 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': 64, '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("alecocc/icd10-hard-negatives")
# Run inference
sentences = [
'CAD',
'Atherosclerotic heart disease of native coronary artery with unspecified angina pectoris',
'Myopia, bilateral',
]
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
#### mimic10-hard-negatives
* Dataset: [mimic10-hard-negatives](https://huggingface.co/datasets/FrancescoBuda/mimic10-hard-negatives) at [ef88fe5](https://huggingface.co/datasets/FrancescoBuda/mimic10-hard-negatives/tree/ef88fe5f449aad48f89f31523c8731e0474d42c1)
* Size: 473,546 training samples
* Columns: anchor
, positive
, negative_1
, negative_2
, negative_3
, negative_4
, negative_5
, negative_6
, negative_7
, negative_8
, negative_9
, and negative_10
* Approximate statistics based on the first 1000 samples:
| | anchor | positive | negative_1 | negative_2 | negative_3 | negative_4 | negative_5 | negative_6 | negative_7 | negative_8 | negative_9 | negative_10 |
|:--------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string | string | string | string | string | string | string | string | string | string | string |
| details |
Anterior exenteration
| Malignant neoplasm of bladder neck
| Malignant neoplasm of unspecified kidney, except renal pelvis
| Malignant neoplasm of unspecified renal pelvis
| Malignant neoplasm of left ureter
| Malignant neoplasm of paraurethral glands
| Malignant neoplasm of left renal pelvis
| Unspecified kyphosis, cervical region
| Unspecified superficial injuries of left back wall of thorax, initial encounter
| Dome fracture of acetabulum
| Other fracture of left great toe, initial encounter for open fracture
| Unspecified fracture of upper end of unspecified radius, subsequent encounter for open fracture type IIIA, IIIB, or IIIC with malunion
|
| Atorvastatin
| Hyperlipidemia, unspecified
| Other lactose intolerance
| Lipomatosis, not elsewhere classified
| Mucopolysaccharidosis, type II
| Hyperuricemia without signs of inflammatory arthritis and tophaceous disease
| Volume depletion, unspecified
| Glaucoma secondary to other eye disorders, unspecified eye
| Fracture of one rib, left side, subsequent encounter for fracture with routine healing
| Toxic effect of other tobacco and nicotine, accidental (unintentional), sequela
| Puncture wound without foreign body of left ring finger with damage to nail
| Nondisplaced fracture of epiphysis (separation) (upper) of unspecified femur, subsequent encounter for open fracture type IIIA, IIIB, or IIIC with nonunion
|
| Urostomy
| Malignant neoplasm of bladder neck
| Malignant neoplasm of urinary organ, unspecified
| Malignant neoplasm of overlapping sites of urinary organs
| Malignant neoplasm of left ureter
| Malignant neoplasm of urethra
| Malignant neoplasm of left renal pelvis
| Indeterminate leprosy
| Poisoning by other viral vaccines, accidental (unintentional)
| Fracture of unspecified metatarsal bone(s), right foot, initial encounter for open fracture
| Sprain of tarsometatarsal ligament of unspecified foot, subsequent encounter
| Burn of first degree of multiple sites of left ankle and foot, initial encounter
|
* 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
- `per_device_train_batch_size`: 128
- `per_device_eval_batch_size`: 128
- `learning_rate`: 2e-05
- `num_train_epochs`: 2
- `warmup_ratio`: 0.1
- `fp16`: True
- `batch_sampler`: no_duplicates
#### All Hyperparameters