---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:2402
- loss:TripletLoss
base_model: microsoft/MiniLM-L12-H384-uncased
widget:
- source_sentence: ' A 58-year-old man suffers a stroke and is admitted to a rehabilitation
unit for physical therapy. He is unable to wash the left side of his body and
denies that his left arm belongs to him even though he clearly visualizes it.'
sentences:
- A
- Examination reveals that the patients somatosensory system is intact. These findings
indicate that the patient may have a lesion. In which area of the brain is the
lesion?n A. Substantia nigra B. Caudate nucleusn C. Right parietal cortex D.
Left parietal cortexn E. Right frontal cortex
- A
- source_sentence: ' Prosopagnosia means the inability to do which of the following?'
sentences:
- A. Recognize faces B. Understand written textn C. Follow directions D. Remember
names E. Read fluently
- A
- A
- source_sentence: ' How long should alcohol be avoided following cessation of disulfiram?'
sentences:
- A
- A
- A. 24 hours B. 3 days C. 7 days D. 1 monthn E. 3 months
- source_sentence: ' Anxiety is a normal emotional response, and a degree of anxiety
is necessary for survival. Pathological anxiety is distinguished from a normal
emotional response by all of the following characteristic features except: '
sentences:
- (
- A. autonomy B. physical health status C. intensityn D. duration E. behavior
- A
- source_sentence: ' Common causes of carpal tunnel syndrome include all of the following
except:'
sentences:
- A
- (
- A. rheumatoid arthritis B. diabetes mellitus C. acromegalyn D. pregnancyn E.
all of the above are possible causes of carpal tunnel syndrome
pipeline_tag: sentence-similarity
library_name: sentence-transformers
---
# SentenceTransformer based on microsoft/MiniLM-L12-H384-uncased
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [microsoft/MiniLM-L12-H384-uncased](https://huggingface.co/microsoft/MiniLM-L12-H384-uncased). It maps sentences & paragraphs to a 384-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:** [microsoft/MiniLM-L12-H384-uncased](https://huggingface.co/microsoft/MiniLM-L12-H384-uncased)
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 384 dimensions
- **Similarity Function:** Cosine Similarity
### 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': 384, '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("jtatman/minilm-L12-H384-psychology")
# Run inference
sentences = [
' Common causes of carpal tunnel syndrome include all of the following except:',
'A',
'A. rheumatoid arthritis B. diabetes mellitus C. acromegalyn D. pregnancyn E. all of the above are possible causes of carpal tunnel syndrome',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
```
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 2,402 training samples
* Columns: sentence_0, sentence_1, and sentence_2
* Approximate statistics based on the first 1000 samples:
| | sentence_0 | sentence_1 | sentence_2 |
|:--------|:-----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
| type | string | string | string |
| details |
An intern on the neurology inpatient unit wonders if there is a good scale to monitor heroin withdrawal in a patient he is taking care of for suspected multiple sclerosis. Which of the following is a good instrument to monitor opioid withdrawal? | A | A. Cut down annoyed guilt eye-opener (CAGE)n B. Michigan Alcohol Screening Test (MAST)n C. Beck Depression Inventory (BDI)n D. Alcohol Use Disorders Identification Test (AUDIT)n E. Clinical Opioid Withdrawal Scale (COWS) |
| The words antibody and antisocial both contain the prefix anti-, which means opposite. A prefix is an example of | ( | (A)babbling. (B)a phoneme. (C)grammar. (D)a morpheme |
| Which of the following is not a feature of generalized seizures? | A | A. Origin from a discrete region of the cerebral cortex B. Unconsciousnessn C. Generalized EEG abnormalities D. Bilateral occurrencen E. Symmetric occurrence |
* Loss: [TripletLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#tripletloss) with these parameters:
```json
{
"distance_metric": "TripletDistanceMetric.EUCLIDEAN",
"triplet_margin": 5
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 32
- `per_device_eval_batch_size`: 32
- `num_train_epochs`: 25
- `fp16`: True
- `multi_dataset_batch_sampler`: round_robin
#### All Hyperparameters