---
base_model: thenlper/gte-base
library_name: sentence-transformers
metrics:
- pearson_cosine
- spearman_cosine
- pearson_manhattan
- spearman_manhattan
- pearson_euclidean
- spearman_euclidean
- pearson_dot
- spearman_dot
- pearson_max
- spearman_max
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:206874
- loss:ContrastiveLoss
widget:
- source_sentence: 'Cardiac silhouette size is top normal. Aorta is tortuous and demonstrates
mild atherosclerotic calcifications diffusely. Hilar contours are normal. Pulmonary
vasculature is normal. Lungs are clear. No pleural effusion or pneumothorax is
present. No acute osseous abnormality is detected. '
sentences:
- 'No acute cardiopulmonary process. '
- 'No acute cardiopulmonary abnormality. '
- 'Normal chest radiographs. '
- source_sentence: 'The lungs are mildly hyperexpanded but clear. No pleural effusion
or pneumothorax is seen. The cardiac and mediastinal silhouettes are unremarkable. '
sentences:
- 'Findings worrisome for early/mild left lower lobe pneumonia. '
- 'No acute cardiopulmonary process. The mediastinum is not widened. '
- 'No radiographic evidence of acute cardiopulmonary disease. '
- source_sentence: 'Lung volumes are slightly low. The cardiomediastinal silhouette
and pulmonary vasculature a similar to the prior examination, and unremarkable,
accounting for low lung volumes. Midline sternal wires are intact and well aligned.
Mediastinal clips and anastomotic markers are noted. The lungs are clear. There
is no pleural effusion or pneumothorax. Bilateral shoulder prostheses are partially
imaged. '
sentences:
- 'No acute cardiopulmonary process. '
- 'No acute intrathoracic abnormality. '
- 'Pulmonary edema, increasing pleural effusions, known mass in the right lower
lung. '
- source_sentence: 'The left hemi thorax remains opacified. The right lung is now
clear. The right mediastinal silhouette is unchanged. An endotracheal tube feeding
tube and right internal jugular catheter remain in place. '
sentences:
- 'The right lung now appears clear. No other significant change. '
- 'No acute cardiopulmonary abnormality. '
- 'Chest findings within normal limits, no secondary metastases suspicious lesions
identified. '
- source_sentence: 'The atient is status post coronary artery bypass graft surgery.
The heart is mildly enlarged. There is a large hiatal hernia with an air-fluid
level. Otherwise, the mediastinal and hilar contours are unremarkable. The lungs
appear clear. The chest is hyperinflated. There is no pleural effusion or pneumothorax.
Bony structures are unremarkable. '
sentences:
- '1. Left apical pneumothorax still small, but considerably larger. Left base pneumothorax
also slightly larger. 2. Minimal lucency adjacent to the the aortic knob may also
represent part of the left lung pneumothorax. Attention to this area on followup
films to exclude any mediastinal air is requested. 3. Extensive subcutaneous emphysema,
equivocally slightly greater than on the prior film. 4. Minimal interval change
in position of the left chest tube. 5. Right pneumothorax also increased, still
small in width, but now seen not only at the right lung apex, but also along the
right lateral chest wall and at the right costophrenic angle in the adjoining
lung base. '
- 'No evidence of acute disease. Normal cardiac size. '
- 'No evidence of acute disease. Hyperinflation. Large hiatal hernia. Status post
coronary artery bypass graft surgery. '
model-index:
- name: SentenceTransformer based on thenlper/gte-base
results:
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: validation
type: validation
metrics:
- type: pearson_cosine
value: 0.8022517557853334
name: Pearson Cosine
- type: spearman_cosine
value: 0.810529949353046
name: Spearman Cosine
- type: pearson_manhattan
value: 0.8243043367211444
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.8105359053829688
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.824484835649088
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.8105299161732425
name: Spearman Euclidean
- type: pearson_dot
value: 0.802251755767147
name: Pearson Dot
- type: spearman_dot
value: 0.8105299280214241
name: Spearman Dot
- type: pearson_max
value: 0.824484835649088
name: Pearson Max
- type: spearman_max
value: 0.8105359053829688
name: Spearman Max
---
# SentenceTransformer based on thenlper/gte-base
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [thenlper/gte-base](https://huggingface.co/thenlper/gte-base). 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:** [thenlper/gte-base](https://huggingface.co/thenlper/gte-base)
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 768 tokens
- **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': 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})
(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("hyojuuun/gte_base_MIMICCXR_FT")
# Run inference
sentences = [
'The atient is status post coronary artery bypass graft surgery. The heart is mildly enlarged. There is a large hiatal hernia with an air-fluid level. Otherwise, the mediastinal and hilar contours are unremarkable. The lungs appear clear. The chest is hyperinflated. There is no pleural effusion or pneumothorax. Bony structures are unremarkable. ',
'No evidence of acute disease. Hyperinflation. Large hiatal hernia. Status post coronary artery bypass graft surgery. ',
'1. Left apical pneumothorax still small, but considerably larger. Left base pneumothorax also slightly larger. 2. Minimal lucency adjacent to the the aortic knob may also represent part of the left lung pneumothorax. Attention to this area on followup films to exclude any mediastinal air is requested. 3. Extensive subcutaneous emphysema, equivocally slightly greater than on the prior film. 4. Minimal interval change in position of the left chest tube. 5. Right pneumothorax also increased, still small in width, but now seen not only at the right lung apex, but also along the right lateral chest wall and at the right costophrenic angle in the adjoining lung base. ',
]
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
#### Semantic Similarity
* Dataset: `validation`
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:-------------------|:-----------|
| pearson_cosine | 0.8023 |
| spearman_cosine | 0.8105 |
| pearson_manhattan | 0.8243 |
| spearman_manhattan | 0.8105 |
| pearson_euclidean | 0.8245 |
| spearman_euclidean | 0.8105 |
| pearson_dot | 0.8023 |
| spearman_dot | 0.8105 |
| pearson_max | 0.8245 |
| **spearman_max** | **0.8105** |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 206,874 training samples
* Columns: sentence_0
, sentence_1
, and label
* Approximate statistics based on the first 1000 samples:
| | sentence_0 | sentence_1 | label |
|:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:--------------------------------------------------------------|
| type | string | string | float |
| details |
The lung volumes are low which accentuates the linear and interstitial opacities. An ill-defined opacity in the left lung in the third/fourth interspace has increased since the prior can be early pneumonia. No pneumothorax. Mild to moderate gastric and small bowel distension partially visualized.
| No evidence of acute cardiopulmonary disease.
| 0.0
|
| PA and lateral views of the chest were provided demonstrating no focal consolidation, effusion or pneumothorax. The cardiomediastinal silhouette is normal. Bony structures are intact. No free air below the right hemidiaphragm.
| No acute intrathoracic process.
| 1.0
|
| Previously seen right-sided PICC is no longer seen. Enlargement of the cardiomediastinal silhouette is grossly stable. There are low lung volumes, which accentuate the bronchovascular markings. No focal consolidation is seen. There is no pleural effusion or pneumothorax.
| Low lung volumes but no focal consolidation to suggest pneumonia.
| 1.0
|
* Loss: [ContrastiveLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#contrastiveloss) with these parameters:
```json
{
"distance_metric": "SiameseDistanceMetric.COSINE_DISTANCE",
"margin": 0.5,
"size_average": true
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 96
- `per_device_eval_batch_size`: 96
- `multi_dataset_batch_sampler`: round_robin
#### All Hyperparameters