BTE-Base-Ar is a leading open-source model based on the Transformer architecture, sIt 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. With only 149 million parameters, it offers a perfect balance between performance and efficiency, outperforming larger models while using significantly fewer resources.
Model Details
Model Description
Model Type: Sentence Transformer
Maximum Sequence Length: 8192 tokens
Output Dimensionality: 768 dimensions
Similarity Function: Cosine Similarity
Language: ar
License: mit
Key Features
Lightweight & Efficient: 149M parameters vs competitors with 278-568M parameters
Long Text Processing: Handles up to 8192 tokens with sliding window technique
High-Speed Inference: 3x faster than comparable models
Arabic Language Optimization: Specifically fine-tuned for Arabic language nuances
Resource Efficient: 75% less memory consumption than competitors
BTE-Base-Ar was trained on a diverse corpus of 741,159,981 tokens from:
Authentic Arabic and English open-source datasets
Manually crafted and processed text
Purpose-generated synthetic data
This comprehensive training approach enables deep understanding of both Arabic & English linguistic contexts.
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.
python
1from sentence_transformers import SentenceTransformer
23# Download from the 🤗 Hub4model = SentenceTransformer("ALJIACHI/bte-base-ar")5# Run inference6sentences =[7'وبيّن: بمقتضى عقيدتنا قُل لَّن يُصِيبَنَا إِلَّا مَا كَتَبَ اللَّهُ لَنَا ، أي أنّ الإنسان المؤمن دائماً يكون في حالة طمأنينة، وهذه العلاقة ما بين العبد وربّه هي علاقة عبدٍ مع سيّده، وكما ورد في بعض الأدعية خيرُك إلينا نازل وشرُّنا إليك صاعد ، نحن نتعامل مع الله سبحانه وتعالى وهو محضُ الخير ومحضُ الرحمة، وكلّ ما يصدر من الله تبارك وتعالى على العبد أن يكون في منتهى العبوديّة والتذلّل اليه جلّ شأنُه .',8'أعلنت وزارة الصحة عن حملة تطعيم وطنية ضد الأمراض المعدية، تهدف إلى حماية الأطفال من العدوى.',9]10embeddings = model.encode(sentences)11print(embeddings.shape)12# [3, 768]1314# Get the similarity scores for the embeddings15similarities = model.similarity(embeddings, embeddings)16print(similarities.shape)17# [3, 3]
If you use BTE-Base-Ar in your research, please cite:
bibtex
1@software{BTE_Base_Ar_2025,
2 author = {Ali Aljiachi},
3 title = {BTE-Base-Ar: A Revolutionary Arabic Text Embeddings Model},
4 year = {2025},
5 publisher = {Hugging Face},
6 url = {https://huggingface.co/Aljiachi/bte-base-ar}
7}
bibtex
1@misc{modernbert,
2 title={Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory Efficient, and Long Context Finetuning and Inference},
3 author={Benjamin Warner and Antoine Chaffin and Benjamin Clavié and Orion Weller and Oskar Hallström and Said Taghadouini and Alexis Gallagher and Raja Biswas and Faisal Ladhak and Tom Aarsen and Nathan Cooper and Griffin Adams and Jeremy Howard and Iacopo Poli},
4 year={2024},
5 eprint={2412.13663},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2412.13663},
9}