AraEuroBert-2.1B / README.md
Omartificial-Intelligence-Space's picture
Update README.md
fb90254 verified
metadata
tags:
  - sentence-transformers
  - sentence-similarity
  - feature-extraction
  - generated_from_trainer
  - dataset_size:2280319
  - loss:MatryoshkaLoss
  - loss:MultipleNegativesRankingLoss
  - Arabic
  - EuroBert
  - Semantic
base_model: EuroBERT/EuroBERT-2.1B
widget:
  - source_sentence: امرأة شقراء تطل على مشهد (سياتل سبيس نيدل)
    sentences:
      - رجل يستمتع بمناظر جسر البوابة الذهبية
      - فتاة بالخارج تلعب في الثلج
      - شخص ما يأخذ في نظرة إبرة الفضاء.
  - source_sentence: سوق الشرق الأوسط
    sentences:
      - مسرح أمريكي
      - متجر في الشرق الأوسط
      - البالغون صغار
  - source_sentence: رجلين يتنافسان في ملابس فنون الدفاع عن النفس
    sentences:
      - هناك العديد من الناس الحاضرين.
      - الكلب الأبيض على الشاطئ
      - هناك شخص واحد فقط موجود.
  - source_sentence: مجموعة من الناس تمشي بجانب شاحنة.
    sentences:
      - الناس يقفون
      - بعض الناس بالخارج
      - بعض الرجال يقودون على الطريق
  - source_sentence: لاعبة كرة ناعمة ترمي الكرة إلى زميلتها في الفريق
    sentences:
      - شخصان يلعبان كرة البيسبول
      - الرجل ينظف
      - لاعبين لكرة البيسبول يجلسان على مقعد
pipeline_tag: feature-extraction
library_name: sentence-transformers
metrics:
  - pearson_cosine
  - spearman_cosine
model-index:
  - name: SentenceTransformer based on EuroBERT/EuroBERT-2.1B
    results:
      - task:
          type: semantic-similarity
          name: Semantic Similarity
        dataset:
          name: sts dev 2304
          type: sts-dev-2304
        metrics:
          - type: pearson_cosine
            value: 0.7268081506530346
            name: Pearson Cosine
          - type: spearman_cosine
            value: 0.7297515677640904
            name: Spearman Cosine
      - task:
          type: semantic-similarity
          name: Semantic Similarity
        dataset:
          name: sts dev 1152
          type: sts-dev-1152
        metrics:
          - type: pearson_cosine
            value: 0.7267206088516627
            name: Pearson Cosine
          - type: spearman_cosine
            value: 0.72990680019899
            name: Spearman Cosine
      - task:
          type: semantic-similarity
          name: Semantic Similarity
        dataset:
          name: sts dev 960
          type: sts-dev-960
        metrics:
          - type: pearson_cosine
            value: 0.7262504495546784
            name: Pearson Cosine
          - type: spearman_cosine
            value: 0.7297095834107545
            name: Spearman Cosine
      - task:
          type: semantic-similarity
          name: Semantic Similarity
        dataset:
          name: sts dev 580
          type: sts-dev-580
        metrics:
          - type: pearson_cosine
            value: 0.7246438630418187
            name: Pearson Cosine
          - type: spearman_cosine
            value: 0.7285747858670478
            name: Spearman Cosine
license: mit
language:
  - ar

Ara-EuroBERT: Arabic Semantic Text Embeddings at Scale

Ara-EuroBERT-2.1B is a sentence-transformers model fine-tuned from EuroBERT/EuroBERT-2.1B, specifically optimized for Arabic semantic embeddings.

This model maps sentences and paragraphs to a 2304-dimensional dense vector space and supports up to 8,192 tokens in a single input sequence.

This model supports Matryoshka (nested) embeddings with the following dimensions:

  • Full dimension: 2304
  • Reduced dimensions: 1151, 960 , 580

You can select the embedding dimension based on your specific requirements, trading off between performance and computational efficiency.

It is suitable for:

  • Semantic textual similarity
  • Semantic search
  • Paraphrase mining
  • Text classification
  • Clustering
  • And other Arabic NLP tasks

You can find more information on the base model at EuroBERT/EuroBERT-2.1B



🧠 Model Details & Benchmark Performance

image/png

🔬 Benchmark Highlights

  • STS17 Benchmark: AraEuroBERT-2.1B achieves a score of 79, significantly outperforming the standard EuroBERT-2.1B (12).
  • STS22.v2 Benchmark: Scores 55, competitive with much smaller and more efficient models.

🧪 Metrics

Semantic Similarity

Metric sts-dev-2304 sts-dev-1152 sts-dev-960 sts-dev-580
Pearson (cosine) 0.7268 0.7267 0.7263 0.7246
Spearman (cosine) 0.7298 0.7299 0.7297 0.7286

📦 Model Description

  • Model Type: Sentence Transformer
  • Base Model: EuroBERT/EuroBERT-2.1B
  • Maximum Sequence Length: 8192 tokens
  • Output Dimensionality: 2304 dimensions (supports nested dimensions: 2304, 1152, 960, 580)
  • Similarity Function: Cosine Similarity
  • Language: Arabic

🧬 Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 8192, 'do_lower_case': False}) with Transformer model: EuroBertModel 
  (1): Pooling({
        'word_embedding_dimension': 2304,
        'pooling_mode_cls_token': False,
        'pooling_mode_mean_tokens': True,
        'pooling_mode_max_tokens': False,
        'include_prompt': True
  })
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

pip install -U sentence-transformers

Then you can load this model and run inference:

from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("Omartificial-Intelligence-Space/AraEuroBert-2.1B")

# Run inference
sentences = [
    'لاعبة كرة ناعمة ترمي الكرة إلى زميلتها في الفريق',
    'شخصان يلعبان كرة البيسبول',
    'لاعبين لكرة البيسبول يجلسان على مقعد',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1152]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

Citation

If you use this model in your research, please cite the following works:

@misc{boizard2025eurobertscalingmultilingualencoders,
      title={EuroBERT: Scaling Multilingual Encoders for European Languages}, 
      author={Nicolas Boizard and Hippolyte Gisserot-Boukhlef and Duarte M. Alves and André Martins and Ayoub Hammal and Caio Corro and Céline Hudelot and Emmanuel Malherbe and Etienne Malaboeuf and Fanny Jourdan and Gabriel Hautreux and João Alves and Kevin El-Haddad and Manuel Faysse and Maxime Peyrard and Nuno M. Guerreiro and Patrick Fernandes and Ricardo Rei and Pierre Colombo},
      year={2025},
      eprint={2503.05500},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2503.05500}, 
}
@inproceedings{reimers-2019-sentence-bert,
    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
    author = "Reimers, Nils and Gurevych, Iryna",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
    month = "11",
    year = "2019",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/1908.10084",
}
@misc{kusupati2024matryoshka,
    title={Matryoshka Representation Learning},
    author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
    year={2024},
    eprint={2205.13147},
    archivePrefix={arXiv},
    primaryClass={cs.LG}
}