🚀 SentenceTransformer based on dunzhang/stella_en_1.5B_v5
This is a sentence-transformers model finetuned from dunzhang/stella_en_1.5B_v5. It maps sentences and paragraphs to a 1024 - dimensional dense vector space, which can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
✨ Features
- Maps sentences and paragraphs to a 1024 - dimensional dense vector space.
- Applicable for various NLP tasks such as semantic textual similarity, semantic search, etc.
📦 Installation
First, you need to install the Sentence Transformers library:
pip install -U sentence-transformers
💻 Usage Examples
Basic Usage
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("sentence_transformers_model_id")
sentences = [
'The Tchaikovsky Symphony Orchestra is a Russian classical music orchestra established in 1930. It was founded as the Moscow Radio Symphony Orchestra, and served as the official symphony for the Soviet All - Union Radio network. Following the dissolution of the, Soviet Union in 1991, the orchestra was renamed in 1993 by the Russian Ministry of Culture in recognition of the central role the music of Tchaikovsky plays in its repertoire. The current music director is Vladimir Fedoseyev, who has been in that position since 1974.',
'Instruct: Given a web search query, retrieve relevant passages that answer the query.\nQuery: Tchaikovsky Symphony Orchestra',
'Instruct: Given a web search query, retrieve relevant passages that answer the query.\nQuery: Sierra del Lacandón',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
📚 Documentation
Model Details
Model Description
Property |
Details |
Model Type |
Sentence Transformer |
Base model |
dunzhang/stella_en_1.5B_v5 |
Maximum Sequence Length |
8096 tokens |
Output Dimensionality |
1024 tokens |
Similarity Function |
Cosine Similarity |
Model Sources
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 8096, 'do_lower_case': False}) with Transformer model: Qwen2Model
(1): Pooling({'word_embedding_dimension': 1536, '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): Dense({'in_features': 1536, 'out_features': 1024, 'bias': True, 'activation_function': 'torch.nn.modules.linear.Identity'})
)
🔧 Technical Details
Evaluation
Metrics
Information Retrieval
Evaluated with InformationRetrievalEvaluator
Metric |
Value |
cosine_accuracy@1 |
0.9448 |
cosine_accuracy@3 |
0.9687 |
cosine_accuracy@5 |
0.9764 |
cosine_accuracy@10 |
0.9811 |
cosine_precision@1 |
0.9448 |
cosine_precision@3 |
0.3229 |
cosine_precision@5 |
0.1953 |
cosine_precision@10 |
0.0981 |
cosine_recall@1 |
0.9448 |
cosine_recall@3 |
0.9687 |
cosine_recall@5 |
0.9764 |
cosine_recall@10 |
0.9811 |
cosine_ndcg@10 |
0.9637 |
cosine_mrr@10 |
0.958 |