SentenceTransformer
This is a sentence-transformers model trained. It maps sentences & paragraphs to a 1024-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
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 1024 dimensions
- Similarity Function: Cosine Similarity
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
(1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, '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:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("collaborativeearth/bge-m3_wri_wflagtraining")
# Run inference
sentences = [
'The weather is lovely today.',
"It's so sunny outside!",
'He drove to the stadium.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
Evaluation
Metrics
Information Retrieval
- Dataset:
ir-eval - Evaluated with
InformationRetrievalEvaluator
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.3645 |
| cosine_accuracy@3 | 0.5668 |
| cosine_accuracy@5 | 0.6421 |
| cosine_accuracy@10 | 0.7365 |
| cosine_precision@1 | 0.3645 |
| cosine_precision@3 | 0.1889 |
| cosine_precision@5 | 0.1284 |
| cosine_precision@10 | 0.0736 |
| cosine_recall@1 | 0.3645 |
| cosine_recall@3 | 0.5668 |
| cosine_recall@5 | 0.6421 |
| cosine_recall@10 | 0.7365 |
| cosine_ndcg@10 | 0.5441 |
| cosine_mrr@10 | 0.4833 |
| cosine_map@100 | 0.4925 |
Training Details
Training Logs
| Epoch | Step | ir-eval_cosine_ndcg@10 |
|---|---|---|
| -1 | -1 | 0.5441 |
Framework Versions
- Python: 3.11.12
- Sentence Transformers: 4.1.0
- Transformers: 4.52.3
- PyTorch: 2.6.0+cu124
- Accelerate: 1.7.0
- Datasets: 3.6.0
- Tokenizers: 0.21.1
Citation
BibTeX
- Downloads last month
- 20
Evaluation results
- Cosine Accuracy@1 on ir evalself-reported0.365
- Cosine Accuracy@3 on ir evalself-reported0.567
- Cosine Accuracy@5 on ir evalself-reported0.642
- Cosine Accuracy@10 on ir evalself-reported0.736
- Cosine Precision@1 on ir evalself-reported0.365
- Cosine Precision@3 on ir evalself-reported0.189
- Cosine Precision@5 on ir evalself-reported0.128
- Cosine Precision@10 on ir evalself-reported0.074
- Cosine Recall@1 on ir evalself-reported0.365
- Cosine Recall@3 on ir evalself-reported0.567
- Cosine Recall@5 on ir evalself-reported0.642
- Cosine Recall@10 on ir evalself-reported0.736
- Cosine Ndcg@10 on ir evalself-reported0.544
- Cosine Mrr@10 on ir evalself-reported0.483
- Cosine Map@100 on ir evalself-reported0.492