---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dense
- generated_from_trainer
- dataset_size:346930
- loss:MultipleNegativesRankingLoss
widget:
- source_sentence: U card
sentences:
- region
- clique
- tokens
- source_sentence: branch
sentences:
- block Half
- bool Code
- schedule
- source_sentence: pair le
sentences:
- trans E
- endpoint
- selected
- source_sentence: loop Trace
sentences:
- blocks
- potential
- Is Blowup
- source_sentence: hit weight
sentences:
- machine
- config
- append
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- cosine_accuracy@1
- cosine_accuracy@3
- cosine_accuracy@5
- cosine_accuracy@10
- cosine_precision@1
- cosine_precision@3
- cosine_precision@5
- cosine_precision@10
- cosine_recall@1
- cosine_recall@3
- cosine_recall@5
- cosine_recall@10
- cosine_ndcg@10
- cosine_mrr@10
- cosine_map@100
model-index:
- name: SentenceTransformer
results:
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: val ir
type: val_ir
metrics:
- type: cosine_accuracy@1
value: 0.2305
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.3385
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.386
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.426
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.2305
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.11283333333333331
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.07719999999999999
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.0426
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.2305
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.3385
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.386
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.426
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.3258681126672316
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.2940464285714284
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.3016717487640095
name: Cosine Map@100
---
# SentenceTransformer
This is a [sentence-transformers](https://www.SBERT.net) model trained. It maps inputs 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
- **Maximum Sequence Length:** 1000000000000000019884624838656 tokens
- **Output Dimensionality:** 768 dimensions
- **Similarity Function:** Cosine Similarity
- **Supported Modalities:** Text, Image, Audio, Video, Message
### 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'}, 'image': {'method': 'forward', 'method_output_name': 'last_hidden_state'}, 'audio': {'method': 'forward', 'method_output_name': 'last_hidden_state'}, 'video': {'method': 'forward', 'method_output_name': 'last_hidden_state'}, 'message': {'method': 'forward', 'method_output_name': 'last_hidden_state', 'format': 'structured'}}, 'module_output_name': 'token_embeddings', 'architecture': 'EmbeddingGemma2Model'})
(1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'mean', 'include_prompt': True})
(2): Normalize({'module_input_name': 'sentence_embedding', 'module_output_name': 'sentence_embedding'})
)
```
## 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
queries = [
'resolution Cokernel Map comp',
]
documents = [
'resolution Cokernel Map',
'potential Of',
'canonical exposure supported',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 768] [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[0.8557, 0.3572, 0.2455]])
```
## Evaluation
### Metrics
#### Information Retrieval
* Dataset: `val_ir`
* Evaluated with [InformationRetrievalEvaluator](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.sentence_transformer.evaluation.InformationRetrievalEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| cosine_accuracy@1 | 0.2305 |
| cosine_accuracy@3 | 0.3385 |
| cosine_accuracy@5 | 0.386 |
| cosine_accuracy@10 | 0.426 |
| cosine_precision@1 | 0.2305 |
| cosine_precision@3 | 0.1128 |
| cosine_precision@5 | 0.0772 |
| cosine_precision@10 | 0.0426 |
| cosine_recall@1 | 0.2305 |
| cosine_recall@3 | 0.3385 |
| cosine_recall@5 | 0.386 |
| cosine_recall@10 | 0.426 |
| **cosine_ndcg@10** | **0.3259** |
| cosine_mrr@10 | 0.294 |
| cosine_map@100 | 0.3017 |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 346,930 training samples
* Columns: anchor and positive
* Approximate statistics based on the first 100 samples:
| | anchor | positive |
|:---------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|
| type | string | string |
| modality | text | text |
| details |
resolution Cokernel Map comp | resolution Cokernel Map |
| potential Of continuous | potential Of |
| sum fully exposed code success probability le | canonical exposure supported |
* 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`: 256
- `num_train_epochs`: 2
- `warmup_steps`: 200
- `bf16`: True
#### All Hyperparameters