🚀 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 许可证。