---
base_model: allenai/specter2_base
library_name: sentence-transformers
metrics:
- cosine_accuracy
- dot_accuracy
- manhattan_accuracy
- euclidean_accuracy
- max_accuracy
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:10053
- loss:MultipleNegativesRankingLoss
widget:
- source_sentence: HBV-endemic area diagnostic criteria comparison
sentences:
- 'Comparison of usefulness of clinical diagnostic criteria for hepatocellular carcinoma
in a hepatitis B endemic area. '
- 'The validation of the 2010 American Association for the Study of Liver Diseases
guideline for the diagnosis of hepatocellular carcinoma in an endemic area. '
- 'Which admission electrocardiographic parameter is more powerful predictor of
no-reflow in patients with acute anterior myocardial infarction who underwent
primary percutaneous intervention? '
- source_sentence: Family history of alcoholism classification schemes
sentences:
- 'Developing the mentor/protege relationship. '
- 'Family history of alcoholism in schizophrenia. '
- 'Family history models of alcoholism: age of onset, consequences and dependence. '
- source_sentence: Intellectual Property Commercialization
sentences:
- 'ALEPH-2, a suspected anxiolytic and putative hallucinogenic phenylisopropylamine
derivative, is a 5-HT2a and 5-HT2c receptor agonist. '
- 'Technology transfer and monitoring practices. '
- '[From intellectual property to commercial property]. '
- source_sentence: Transmembrane domain mutants
sentences:
- 'Dysgerminoma; case with pulmonary metastases; result of treatment with irradiation
and male sex hormone. '
- 'Toward a high-resolution structure of phospholamban: design of soluble transmembrane
domain mutants. '
- 'Scanning N-glycosylation mutagenesis of membrane proteins. '
- source_sentence: Six-coordinate low-spin iron(III) porphyrinate complexes
sentences:
- 'Molecular structures and magnetic resonance spectroscopic investigations of highly
distorted six-coordinate low-spin iron(III) porphyrinate complexes. '
- 'Saddle-shaped six-coordinate iron(iii) porphyrin complex with unusual intermediate-spin
electronic structure. '
- 'Performing Economic Evaluation of Integrated Care: Highway to Hell or Stairway
to Heaven? '
model-index:
- name: SentenceTransformer based on allenai/specter2_base
results:
- task:
type: triplet
name: Triplet
dataset:
name: triplet dev
type: triplet-dev
metrics:
- type: cosine_accuracy
value: 0.606
name: Cosine Accuracy
- type: dot_accuracy
value: 0.395
name: Dot Accuracy
- type: manhattan_accuracy
value: 0.603
name: Manhattan Accuracy
- type: euclidean_accuracy
value: 0.615
name: Euclidean Accuracy
- type: max_accuracy
value: 0.615
name: Max Accuracy
---
# SentenceTransformer based on allenai/specter2_base
This model is an initial proof of concept for (yet unpublished) article on ultra-hard negative triplet generation. While the original Specter2 adapters were trained on 600k triplets, only 10k ultra-hard negatives were enough to outperform the Proximity adapter.
## Model Details
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 Description
- **Model Type:** Sentence Transformer
- **Base model:** [allenai/specter2_base](https://huggingface.co/allenai/specter2_base)
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 768 tokens
- **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 = [
'Six-coordinate low-spin iron(III) porphyrinate complexes',
'Molecular structures and magnetic resonance spectroscopic investigations of highly distorted six-coordinate low-spin iron(III) porphyrinate complexes. ',
'Saddle-shaped six-coordinate iron(iii) porphyrin complex with unusual intermediate-spin electronic structure. ',
]
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
#### Triplet
* Dataset: `triplet-dev`
* Evaluated with [TripletEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.TripletEvaluator)
| Metric | Value |
|:--------------------|:----------|
| **cosine_accuracy** | **0.606** |
| dot_accuracy | 0.395 |
| manhattan_accuracy | 0.603 |
| euclidean_accuracy | 0.615 |
| max_accuracy | 0.615 |
## Training Details
### Training Dataset
#### json
* Dataset: json
* Size: 10,053 training samples
* Columns: anchor
, positive
, and negative
* Approximate statistics based on the first 1000 samples:
| | anchor | positive | negative |
|:--------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string | string |
| details |
COM-induced secretome changes in U937 monocytes
| Characterization of calcium oxalate crystal-induced changes in the secretome of U937 human monocytes.
| Monocytes.
|
| Metamaterials
| Sound attenuation optimization using metaporous materials tuned on exceptional points.
| Metamaterials: A cat's eye for all directions.
|
| Pediatric Parasitology
| Parasitic infections among school age children 6 to 11-years-of-age in the Eastern province.
| [DIALOGUE ON PEDIATRIC PARASITOLOGY].
|
* 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`: 32
- `per_device_eval_batch_size`: 32
- `learning_rate`: 2e-05
- `num_train_epochs`: 6
- `lr_scheduler_type`: cosine_with_restarts
- `warmup_ratio`: 0.1
- `bf16`: True
- `batch_sampler`: no_duplicates
#### All Hyperparameters