---
language: []
library_name: sentence-transformers
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:1115700
- loss:MatryoshkaLoss
- loss:MultipleNegativesRankingLoss
base_model: nomic-ai/nomic-embed-text-v1.5
datasets: []
metrics:
- pearson_cosine
- spearman_cosine
- pearson_manhattan
- spearman_manhattan
- pearson_euclidean
- spearman_euclidean
- pearson_dot
- spearman_dot
- pearson_max
- spearman_max
widget:
- source_sentence: Ndege mwenye mdomo mrefu katikati ya ndege.
sentences:
- Panya anayekimbia juu ya gurudumu.
- Mtu anashindana katika mashindano ya mbio.
- Ndege anayeruka.
- source_sentence: Msichana mchanga mwenye nywele nyeusi anakabili kamera na kushikilia
mfuko wa karatasi wakati amevaa shati la machungwa na mabawa ya kipepeo yenye
rangi nyingi.
sentences:
- Mwanamke mzee anakataa kupigwa picha.
- mtu akila na mvulana mdogo kwenye kijia cha jiji
- Msichana mchanga anakabili kamera.
- source_sentence: Wanawake na watoto wameketi nje katika kivuli wakati kikundi cha
watoto wadogo wameketi ndani katika kivuli.
sentences:
- Mwanamke na watoto na kukaa chini.
- Mwanamke huyo anakimbia.
- Watu wanasafiri kwa baiskeli.
- source_sentence: Mtoto mdogo anaruka mikononi mwa mwanamke aliyevalia suti nyeusi
ya kuogelea akiwa kwenye dimbwi.
sentences:
- Mtoto akiruka mikononi mwa mwanamke aliyevalia suti ya kuogelea kwenye dimbwi.
- Someone is holding oranges and walking
- Mama na binti wakinunua viatu.
- source_sentence: Mwanamume na mwanamke wachanga waliovaa mikoba wanaweka au kuondoa
kitu kutoka kwenye mti mweupe wa zamani, huku watu wengine wamesimama au wameketi
nyuma.
sentences:
- tai huruka
- mwanamume na mwanamke wenye mikoba
- Wanaume wawili wameketi karibu na mwanamke.
pipeline_tag: sentence-similarity
model-index:
- name: SentenceTransformer based on nomic-ai/nomic-embed-text-v1.5
results:
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: sts test 768
type: sts-test-768
metrics:
- type: pearson_cosine
value: 0.6944960057464138
name: Pearson Cosine
- type: spearman_cosine
value: 0.6872396378196957
name: Spearman Cosine
- type: pearson_manhattan
value: 0.7086043588614903
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.7136479613274518
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.7084460037709435
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.7128357831285198
name: Spearman Euclidean
- type: pearson_dot
value: 0.481902874304561
name: Pearson Dot
- type: spearman_dot
value: 0.46588918379526945
name: Spearman Dot
- type: pearson_max
value: 0.7086043588614903
name: Pearson Max
- type: spearman_max
value: 0.7136479613274518
name: Spearman Max
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: sts test 512
type: sts-test-512
metrics:
- type: pearson_cosine
value: 0.6925787246105148
name: Pearson Cosine
- type: spearman_cosine
value: 0.6859479129419207
name: Spearman Cosine
- type: pearson_manhattan
value: 0.7087290093387656
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.7127968133455542
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.7088805484816247
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.7123606046721803
name: Spearman Euclidean
- type: pearson_dot
value: 0.4684333245586192
name: Pearson Dot
- type: spearman_dot
value: 0.45257836578849003
name: Spearman Dot
- type: pearson_max
value: 0.7088805484816247
name: Pearson Max
- type: spearman_max
value: 0.7127968133455542
name: Spearman Max
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: sts test 256
type: sts-test-256
metrics:
- type: pearson_cosine
value: 0.6876956481856266
name: Pearson Cosine
- type: spearman_cosine
value: 0.6814892249857147
name: Spearman Cosine
- type: pearson_manhattan
value: 0.7083882582081078
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.7097524143994903
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.7094190252305796
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.7104287347206688
name: Spearman Euclidean
- type: pearson_dot
value: 0.4438925722484721
name: Pearson Dot
- type: spearman_dot
value: 0.4255299982188107
name: Spearman Dot
- type: pearson_max
value: 0.7094190252305796
name: Pearson Max
- type: spearman_max
value: 0.7104287347206688
name: Spearman Max
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: sts test 128
type: sts-test-128
metrics:
- type: pearson_cosine
value: 0.6708560165075523
name: Pearson Cosine
- type: spearman_cosine
value: 0.6669935075512006
name: Spearman Cosine
- type: pearson_manhattan
value: 0.7041961281711793
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.7000807688296651
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.7055061381768357
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.7022686907818495
name: Spearman Euclidean
- type: pearson_dot
value: 0.37855771167572094
name: Pearson Dot
- type: spearman_dot
value: 0.35930717422088765
name: Spearman Dot
- type: pearson_max
value: 0.7055061381768357
name: Pearson Max
- type: spearman_max
value: 0.7022686907818495
name: Spearman Max
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: sts test 64
type: sts-test-64
metrics:
- type: pearson_cosine
value: 0.6533817775144477
name: Pearson Cosine
- type: spearman_cosine
value: 0.6523997361414113
name: Spearman Cosine
- type: pearson_manhattan
value: 0.6919834348567717
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.6857245312336051
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.6950438027503257
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.6899151458827059
name: Spearman Euclidean
- type: pearson_dot
value: 0.33502302384042637
name: Pearson Dot
- type: spearman_dot
value: 0.3097469345046609
name: Spearman Dot
- type: pearson_max
value: 0.6950438027503257
name: Pearson Max
- type: spearman_max
value: 0.6899151458827059
name: Spearman Max
---
# SentenceTransformer based on nomic-ai/nomic-embed-text-v1.5
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [nomic-ai/nomic-embed-text-v1.5](https://huggingface.co/nomic-ai/nomic-embed-text-v1.5) on the Mollel/swahili-n_li-triplet-swh-eng 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 Details
### Model Description
- **Model Type:** Sentence Transformer
- **Base model:** [nomic-ai/nomic-embed-text-v1.5](https://huggingface.co/nomic-ai/nomic-embed-text-v1.5)
- **Maximum Sequence Length:** 8192 tokens
- **Output Dimensionality:** 768 tokens
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
- Mollel/swahili-n_li-triplet-swh-eng
### 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': 8192, 'do_lower_case': False}) with Transformer model: NomicBertModel
(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("Mollel/MultiLinguSwahili-nomic-embed-text-v1.5-nli-matryoshka")
# Run inference
sentences = [
'Mwanamume na mwanamke wachanga waliovaa mikoba wanaweka au kuondoa kitu kutoka kwenye mti mweupe wa zamani, huku watu wengine wamesimama au wameketi nyuma.',
'mwanamume na mwanamke wenye mikoba',
'tai huruka',
]
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
#### Semantic Similarity
* Dataset: `sts-test-768`
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| pearson_cosine | 0.6945 |
| **spearman_cosine** | **0.6872** |
| pearson_manhattan | 0.7086 |
| spearman_manhattan | 0.7136 |
| pearson_euclidean | 0.7084 |
| spearman_euclidean | 0.7128 |
| pearson_dot | 0.4819 |
| spearman_dot | 0.4659 |
| pearson_max | 0.7086 |
| spearman_max | 0.7136 |
#### Semantic Similarity
* Dataset: `sts-test-512`
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| pearson_cosine | 0.6926 |
| **spearman_cosine** | **0.6859** |
| pearson_manhattan | 0.7087 |
| spearman_manhattan | 0.7128 |
| pearson_euclidean | 0.7089 |
| spearman_euclidean | 0.7124 |
| pearson_dot | 0.4684 |
| spearman_dot | 0.4526 |
| pearson_max | 0.7089 |
| spearman_max | 0.7128 |
#### Semantic Similarity
* Dataset: `sts-test-256`
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| pearson_cosine | 0.6877 |
| **spearman_cosine** | **0.6815** |
| pearson_manhattan | 0.7084 |
| spearman_manhattan | 0.7098 |
| pearson_euclidean | 0.7094 |
| spearman_euclidean | 0.7104 |
| pearson_dot | 0.4439 |
| spearman_dot | 0.4255 |
| pearson_max | 0.7094 |
| spearman_max | 0.7104 |
#### Semantic Similarity
* Dataset: `sts-test-128`
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:--------------------|:----------|
| pearson_cosine | 0.6709 |
| **spearman_cosine** | **0.667** |
| pearson_manhattan | 0.7042 |
| spearman_manhattan | 0.7001 |
| pearson_euclidean | 0.7055 |
| spearman_euclidean | 0.7023 |
| pearson_dot | 0.3786 |
| spearman_dot | 0.3593 |
| pearson_max | 0.7055 |
| spearman_max | 0.7023 |
#### Semantic Similarity
* Dataset: `sts-test-64`
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| pearson_cosine | 0.6534 |
| **spearman_cosine** | **0.6524** |
| pearson_manhattan | 0.692 |
| spearman_manhattan | 0.6857 |
| pearson_euclidean | 0.695 |
| spearman_euclidean | 0.6899 |
| pearson_dot | 0.335 |
| spearman_dot | 0.3097 |
| pearson_max | 0.695 |
| spearman_max | 0.6899 |
## Training Details
### Training Dataset
#### Mollel/swahili-n_li-triplet-swh-eng
* Dataset: Mollel/swahili-n_li-triplet-swh-eng
* Size: 1,115,700 training samples
* Columns: anchor
, positive
, and negative
* Approximate statistics based on the first 1000 samples:
| | anchor | positive | negative |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|
| type | string | string | string |
| details |
A person on a horse jumps over a broken down airplane.
| A person is outdoors, on a horse.
| A person is at a diner, ordering an omelette.
|
| Mtu aliyepanda farasi anaruka juu ya ndege iliyovunjika.
| Mtu yuko nje, juu ya farasi.
| Mtu yuko kwenye mkahawa, akiagiza omelette.
|
| Children smiling and waving at camera
| There are children present
| The kids are frowning
|
* Loss: [MatryoshkaLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
```json
{
"loss": "MultipleNegativesRankingLoss",
"matryoshka_dims": [
768,
512,
256,
128,
64
],
"matryoshka_weights": [
1,
1,
1,
1,
1
],
"n_dims_per_step": -1
}
```
### Evaluation Dataset
#### Mollel/swahili-n_li-triplet-swh-eng
* Dataset: Mollel/swahili-n_li-triplet-swh-eng
* Size: 13,168 evaluation samples
* Columns: anchor
, positive
, and negative
* Approximate statistics based on the first 1000 samples:
| | anchor | positive | negative |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|
| type | string | string | string |
| details | Two women are embracing while holding to go packages.
| Two woman are holding packages.
| The men are fighting outside a deli.
|
| Wanawake wawili wanakumbatiana huku wakishikilia vifurushi vya kwenda.
| Wanawake wawili wanashikilia vifurushi.
| Wanaume hao wanapigana nje ya duka la vyakula vitamu.
|
| Two young children in blue jerseys, one with the number 9 and one with the number 2 are standing on wooden steps in a bathroom and washing their hands in a sink.
| Two kids in numbered jerseys wash their hands.
| Two kids in jackets walk to school.
|
* Loss: [MatryoshkaLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
```json
{
"loss": "MultipleNegativesRankingLoss",
"matryoshka_dims": [
768,
512,
256,
128,
64
],
"matryoshka_weights": [
1,
1,
1,
1,
1
],
"n_dims_per_step": -1
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 24
- `per_device_eval_batch_size`: 24
- `learning_rate`: 2e-05
- `num_train_epochs`: 1
- `warmup_ratio`: 0.1
- `bf16`: True
- `batch_sampler`: no_duplicates
#### All Hyperparameters