---
base_model: nomic-ai/modernbert-embed-base
language:
- fr
library_name: sentence-transformers
license: apache-2.0
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_ndcg@15
- cosine_ndcg@20
- cosine_mrr@10
- cosine_map@100
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:47560
- loss:MatryoshkaLoss
- loss:MultipleNegativesRankingLoss
widget:
- source_sentence: Pourquoi l'enfant de Jéroboam sera-t-il le seul de sa maison à
être enterré?
sentences:
- Nathan le prophète.
- Parce qu'il est le seul de la maison de Jéroboam en qui se soit trouvé quelque
chose de bon devant l'Éternel, le Dieu d'Israël.
- Deux ans.
- source_sentence: Que dit le texte sur la foi capable de transporter des montagnes
sans charité?
sentences:
- Urie était un Héthien.
- Il dit que même avec une foi capable de transporter des montagnes, sans la charité,
cela ne vaut rien.
- David est allé se présenter devant l'Éternel et a exprimé son humilité et sa gratitude
envers Dieu.
- source_sentence: Quels sont les noms des fils de Schobal?
sentences:
- Reaja, Jachath, Achumaï et Lahad.
- Le côté du midi échut à Obed-Édom, et la maison des magasins à ses fils.
- Meschélémia avait dix-huit fils et frères vaillants.
- source_sentence: Qui a succédé au roi Asa après sa mort?
sentences:
- 'L''un dit: Moi, je suis de Paul! Et un autre: Moi, d''Apollos!'
- 'Neuf fils: Zemira, Joasch, Éliézer, Éljoénaï, Omri, Jerémoth, Abija, Anathoth
et Alameth, enregistrés au nombre de vingt mille deux cents.'
- Josaphat, son fils.
- source_sentence: Quelles tâches les Lévites devaient-ils accomplir dans le service
de la maison de l'Éternel?
sentences:
- Ils devaient prendre soin des parvis et des chambres, purifier toutes les choses
saintes, s'occuper des pains de proposition, de la fleur de farine pour les offrandes,
des galettes sans levain, des gâteaux cuits sur la plaque et des gâteaux frits,
et de toutes les mesures de capacité et de longueur.
- Les chefs des maisons paternelles, les chefs des tribus d'Israël, les chefs de
milliers et de centaines, et les intendants du roi.
- Les enfants sont considérés comme saints.
co2_eq_emissions:
emissions: 11.494424944753328
energy_consumed: 0.20511474053343792
source: codecarbon
training_type: fine-tuning
on_cloud: false
cpu_model: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
ram_total_size: 7.6847381591796875
hours_used: 6.806
hardware_used: 1 x NVIDIA GeForce GTX 1660 Ti
model-index:
- name: modernbert-embed-base-bible
results:
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 768
type: dim_768
metrics:
- type: cosine_accuracy@1
value: 0.17498667614141056
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.24835672410730147
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.2762480014212116
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.320305560490318
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.17498667614141056
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.08278557470243382
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.05524960028424231
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.0320305560490318
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.17498667614141056
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.24835672410730147
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.2762480014212116
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.320305560490318
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.24430049048684818
name: Cosine Ndcg@10
- type: cosine_ndcg@15
value: 0.2525347835304927
name: Cosine Ndcg@15
- type: cosine_ndcg@20
value: 0.2574496509992833
name: Cosine Ndcg@20
- type: cosine_mrr@10
value: 0.2204687601338871
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.22764969395073778
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 512
type: dim_512
metrics:
- type: cosine_accuracy@1
value: 0.17161129863208385
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.24018475750577367
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.2719843666725884
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.31621957718955407
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.17161129863208385
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.08006158583525788
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.05439687333451768
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.03162195771895541
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.17161129863208385
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.24018475750577367
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.2719843666725884
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.31621957718955407
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.23947113373513576
name: Cosine Ndcg@10
- type: cosine_ndcg@15
value: 0.24636222462199156
name: Cosine Ndcg@15
- type: cosine_ndcg@20
value: 0.2517242130957284
name: Cosine Ndcg@20
- type: cosine_mrr@10
value: 0.2154852845384024
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.2225725360678114
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 256
type: dim_256
metrics:
- type: cosine_accuracy@1
value: 0.16024160596908865
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.22757150470776336
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.2602593711138746
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.3075146562444484
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.16024160596908865
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.07585716823592112
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.052051874222774915
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.030751465624444838
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.16024160596908865
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.22757150470776336
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.2602593711138746
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.3075146562444484
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.22844579790475078
name: Cosine Ndcg@10
- type: cosine_ndcg@15
value: 0.2357050364715922
name: Cosine Ndcg@15
- type: cosine_ndcg@20
value: 0.24051535612507915
name: Cosine Ndcg@20
- type: cosine_mrr@10
value: 0.20381231547513284
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.21077486383464478
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 128
type: dim_128
metrics:
- type: cosine_accuracy@1
value: 0.14372002131817374
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.20465446793391368
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.23307869959140168
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.279445727482679
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.14372002131817374
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.06821815597797122
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.04661573991828033
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.0279445727482679
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.14372002131817374
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.20465446793391368
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.23307869959140168
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.279445727482679
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.20572968417646773
name: Cosine Ndcg@10
- type: cosine_ndcg@15
value: 0.21411686675503838
name: Cosine Ndcg@15
- type: cosine_ndcg@20
value: 0.21935674398662894
name: Cosine Ndcg@20
- type: cosine_mrr@10
value: 0.1828928000406064
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.19012440317942259
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 64
type: dim_64
metrics:
- type: cosine_accuracy@1
value: 0.11067685201634393
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.15953100017765146
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.18617871735654645
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.22721620181204477
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.11067685201634393
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.05317700005921715
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.03723574347130929
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.022721620181204476
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.11067685201634393
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.15953100017765146
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.18617871735654645
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.22721620181204477
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.16327341570689552
name: Cosine Ndcg@10
- type: cosine_ndcg@15
value: 0.1699977455983759
name: Cosine Ndcg@15
- type: cosine_ndcg@20
value: 0.17462327712912765
name: Cosine Ndcg@20
- type: cosine_mrr@10
value: 0.1435284115422685
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.1500325081763102
name: Cosine Map@100
---
# modernbert-embed-base-bible
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [nomic-ai/modernbert-embed-base](https://huggingface.co/nomic-ai/modernbert-embed-base) on the json 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/modernbert-embed-base](https://huggingface.co/nomic-ai/modernbert-embed-base)
- **Maximum Sequence Length:** 8192 tokens
- **Output Dimensionality:** 768 dimensions
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
- json
- **Language:** fr
- **License:** apache-2.0
### 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: ModernBertModel
(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})
(2): Normalize()
)
```
## 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("Steve77/modernbert-embed-base-bible")
# Run inference
sentences = [
"Quelles tâches les Lévites devaient-ils accomplir dans le service de la maison de l'Éternel?",
"Ils devaient prendre soin des parvis et des chambres, purifier toutes les choses saintes, s'occuper des pains de proposition, de la fleur de farine pour les offrandes, des galettes sans levain, des gâteaux cuits sur la plaque et des gâteaux frits, et de toutes les mesures de capacité et de longueur.",
"Les chefs des maisons paternelles, les chefs des tribus d'Israël, les chefs de milliers et de centaines, et les intendants du roi.",
]
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
#### Information Retrieval
* Datasets: `dim_768`, `dim_512`, `dim_256`, `dim_128` and `dim_64`
* Evaluated with [InformationRetrievalEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
| Metric | dim_768 | dim_512 | dim_256 | dim_128 | dim_64 |
|:--------------------|:-----------|:-----------|:-----------|:-----------|:-----------|
| cosine_accuracy@1 | 0.175 | 0.1716 | 0.1602 | 0.1437 | 0.1107 |
| cosine_accuracy@3 | 0.2484 | 0.2402 | 0.2276 | 0.2047 | 0.1595 |
| cosine_accuracy@5 | 0.2762 | 0.272 | 0.2603 | 0.2331 | 0.1862 |
| cosine_accuracy@10 | 0.3203 | 0.3162 | 0.3075 | 0.2794 | 0.2272 |
| cosine_precision@1 | 0.175 | 0.1716 | 0.1602 | 0.1437 | 0.1107 |
| cosine_precision@3 | 0.0828 | 0.0801 | 0.0759 | 0.0682 | 0.0532 |
| cosine_precision@5 | 0.0552 | 0.0544 | 0.0521 | 0.0466 | 0.0372 |
| cosine_precision@10 | 0.032 | 0.0316 | 0.0308 | 0.0279 | 0.0227 |
| cosine_recall@1 | 0.175 | 0.1716 | 0.1602 | 0.1437 | 0.1107 |
| cosine_recall@3 | 0.2484 | 0.2402 | 0.2276 | 0.2047 | 0.1595 |
| cosine_recall@5 | 0.2762 | 0.272 | 0.2603 | 0.2331 | 0.1862 |
| cosine_recall@10 | 0.3203 | 0.3162 | 0.3075 | 0.2794 | 0.2272 |
| cosine_ndcg@10 | 0.2443 | 0.2395 | 0.2284 | 0.2057 | 0.1633 |
| cosine_ndcg@15 | 0.2525 | 0.2464 | 0.2357 | 0.2141 | 0.17 |
| **cosine_ndcg@20** | **0.2574** | **0.2517** | **0.2405** | **0.2194** | **0.1746** |
| cosine_mrr@10 | 0.2205 | 0.2155 | 0.2038 | 0.1829 | 0.1435 |
| cosine_map@100 | 0.2276 | 0.2226 | 0.2108 | 0.1901 | 0.15 |
## Training Details
### Training Dataset
#### json
* Dataset: json
* Size: 47,560 training samples
* Columns: anchor
and positive
* Approximate statistics based on the first 1000 samples:
| | anchor | positive |
|:--------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
| type | string | string |
| details |
Quels sont les noms des fils de Schobal?
| Aljan, Manahath, Ébal, Schephi et Onam
|
| Quels sont les noms des fils de Tsibeon?
| Ajja et Ana
|
| Qui est le fils d'Ana?
| Dischon
|
* 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
- `eval_strategy`: epoch
- `per_device_train_batch_size`: 16
- `per_device_eval_batch_size`: 16
- `gradient_accumulation_steps`: 16
- `learning_rate`: 2e-05
- `num_train_epochs`: 4
- `lr_scheduler_type`: cosine
- `warmup_ratio`: 0.1
- `bf16`: True
- `load_best_model_at_end`: True
- `optim`: adamw_torch_fused
- `batch_sampler`: no_duplicates
#### All Hyperparameters