Views
No views yet
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})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("collaborativeearth/bge-m3_wri_wflagtraining")
5# Run inference
6sentences = [
7 'The weather is lovely today.',
8 "It's so sunny outside!",
9 'He drove to the stadium.',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 1024]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities.shape)
18# [3, 3]ir-evalInformationRetrievalEvaluator| 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 |
| Epoch | Step | ir-eval_cosine_ndcg@10 |
|---|---|---|
| -1 | -1 | 0.5441 |