---
language:
- nl
license: apache-2.0
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:8066634
- loss:MultipleNegativesRankingLoss
widget:
- source_sentence: Er kwamen drie mysterieuze mannen ter hulp.
sentences:
- Drie vreemde lui hielpte ons dan.
- Er kwamen drie zwarte vogels in onze tuin.
- Er zijn mensen die hulpzaam zijn.
- Een, twee, drie... Wie kan de volgende cijfers aanraden?
pipeline_tag: sentence-similarity
library_name: sentence-transformers
---
# FMMB-BE-NL: The Fairly Multilingual ModernBERT Embedding Model (Belgian Edition): Monolingual Dutch version.
🇳🇱 This monolingual Dutch version of the [Fairly Multilingual ModernBERT Embedding Model (Belgian Edition)](https://huggingface.co/Parallia/Fairly-Multilingual-ModernBERT-Embed-BE) is the perfect model for embedding texts up to 8192 tokens written in Dutch at the speed of light. It uses the exact same weights as the original FMMB-BE model, and therefore produces identical embeddings, but this version comes with only a Dutch-optimized tokenizer and its associated embedding table, thereby improving performance.
🆘 This [sentence-transformers](https://www.SBERT.net) model was trained on a small parallel corpus containing English-French, English-Dutch, and English-German sentence pairs. 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. The input texts can be used as-is, no need to use prefixes.
🪄 Thanks to the magic of [Trans-Tokenization](https://huggingface.co/papers/2408.04303), monoligual English models such as [ModernBERT-Embed from Nomic AI](https://huggingface.co/nomic-ai/modernbert-embed-base) can be turned into embedding models for another language. And this, with almost no GPU compute involved! 🤯
⚖️ Each of the 5 FMMB-BE models are actually copies of the exact same model, paired with different tokenizers and embedding tables. Indeed, as all trans-tokenized models operate on embeddings in the same latent space, aligning them cross-lingually is a breeze: after creating a "super" model which can speak in all of the 4 tokenizers, this model can be finetuned to produce similar embeddings for sentences which are translation of each other.
⚡ ModernBERT, developped last month by Answer Ai and LightOn, is about 3x to 6x faster at inference time than regular BERT/RoBERTa models, while providing us with superior results. This makes it a wonderful choice for many use cases.
## Model Details
### Model Description
- **Model Type:** Sentence Transformer
- **Base model:** [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:**
- parallel-sentences
- **Languages:** nl
- **License:** apache-2.0
### 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})
)
```
## Usage
**IMPORTANT:** While waiting for the next stable release of the `transformers` library, please install the latest git release to use `modernbert` models:
```bash
pip install --upgrade git+https://github.com/huggingface/transformers.git
```
The easiest way to use this model is to 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("Parallia/Fairly-Multilingual-ModernBERT-Embed-BE-NL")
# Run inference
sentences = [
'Er kwamen drie mysterieuze mannen ter hulp.',
'Drie vreemde lui hielpte ons dan.',
'Er kwamen drie zwarte vogels in onze tuin.',
'Er zijn mensen die hulpzaam zijn.',
'Een, twee, drie... Wie kan de volgende cijfers aanraden?',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [5, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [5, 5]
```
## Training Details
### Training Dataset
#### parallel-sentences
* Dataset: parallel dataset
* Size: 8,066,634 training samples
* Columns: sent1
and sent2
* Approximate statistics based on the first 1000 samples:
| | sent1 | sent2 |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string |
| details |
The faces may change, but the essential views that have characterised Israel’s government for decades will remain the same after 9 April
| Les visages peuvent changer, mais les opinions fondamentales qui caractérisent le gouvernement israélien depuis des décennies resteront les mêmes après le 9 avril
|
| - Yeah. My husband never talked about business.
| M'n man had het nooit over z'n zaken.
|
| Or do they think that We hear not their secrets and their private counsels?
| Oder meinen sie, daß Wir ihre Geheimnisse und heimlichen Beratungen nicht hören?
|
* Loss: [MultipleNegativesRankingLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "cos_sim"
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 256
- `per_device_eval_batch_size`: 256
- `learning_rate`: 2e-05
- `num_train_epochs`: 1
- `warmup_ratio`: 0.1
- `bf16`: True
#### All Hyperparameters