🚀 Ara - EuroBERT:大規模阿拉伯語語義文本嵌入模型
Ara - EuroBERT - 2.1B 是一個基於 [EuroBERT/EuroBERT - 2.1B](https://huggingface.co/EuroBERT/EuroBERT - 2.1B) 微調的 sentence - transformers 模型,專門針對 阿拉伯語語義嵌入 進行了優化。
該模型可將句子和段落映射到一個 2304 維的密集向量空間,並且支持在單個輸入序列中處理 多達 8192 個標記。
模型標籤與信息
屬性 |
詳情 |
模型類型 |
Sentence Transformer |
基礎模型 |
[EuroBERT/EuroBERT - 2.1B](https://huggingface.co/EuroBERT/EuroBERT - 2.1B) |
訓練數據 |
未提及 |
損失函數 |
MatryoshkaLoss、MultipleNegativesRankingLoss |
支持語言 |
阿拉伯語 |
評估指標 |
Pearson Cosine、Spearman Cosine |
模型特性
- 多維度嵌入支持:該模型支持 Matryoshka(嵌套)嵌入,具有以下維度:
- 全維度:2304
- 降維維度:1151、960、580
你可以根據具體需求選擇嵌入維度,在性能和計算效率之間進行權衡。
- 適用場景廣泛:適用於語義文本相似度、語義搜索、釋義挖掘、文本分類、聚類等阿拉伯語自然語言處理任務。
基準測試表現

基準測試亮點
- STS17 基準測試:AraEuroBERT - 2.1B 取得了 79 分的成績,顯著優於標準的 EuroBERT - 2.1B(12 分)。
- STS22.v2 基準測試:得分 55,與更小、更高效的模型相比具有競爭力。
語義相似度指標
指標 |
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 |
完整模型架構
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
})
)
使用示例
基礎用法
首先安裝 Sentence Transformers 庫:
pip install -U sentence-transformers
然後加載模型並進行推理:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("Omartificial-Intelligence-Space/AraEuroBert-2.1B")
sentences = [
'لاعبة كرة ناعمة ترمي الكرة إلى زميلتها في الفريق',
'شخصان يلعبان كرة البيسبول',
'لاعبين لكرة البيسبول يجلسان على مقعد',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
引用說明
如果你在研究中使用了該模型,請引用以下文獻:
@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}
}
許可證
本模型使用 MIT 許可證。