Views
No views yet
Omartificial-Intelligence-Space/Arabic-Triplet-Matryoshka-V2, the
state-of-the-art Arabic embedding model (ATM2), laid out for the
transformers.js (@huggingface/transformers) web runtime. It powers the
"بالذكاء الاصطناعي" (AI) semantic-search tab of the open-mushaf Quran reader
in the browser (PWA).| Attribute | Value |
|---|---|
| Base model | aubmindlab/bert-base-arabertv02 |
| Embedding dimension | 768 |
| Parameters | 135M |
| Pretrained model format | fp32 safetensors |
| This export | INT8 dynamic-quantized ONNX (onnx/model_quantized.onnx) |
| Runtime | @huggingface/transformers (transformers.js) WASM backend |
| License | Apache-2.0 |
q8 dtype.MatryoshkaLoss + MultipleNegativesRankingLoss.akhooli/arabic-triplets-1m-curated-sims-len (1M samples).| Model | Dim | Params | STS17 | STS22-v2 | Avg |
|---|---|---|---|---|---|
| ATM-V2 (this repo base) | 768 | 135M | 85 | 64 | 75 |
Omartificial-Intelligence-Space/Arabic-Triplet-Matryoshka-V2
card for the full comparison table.transformers.js:config.json
tokenizer.json
tokenizer_config.json
special_tokens_map.json
onnx/model_quantized.onnxdtype: 'q8', transformers.js resolves the
q8 precision to onnx/model_quantized.onnx. The repo must remain
public — transformers.js fetches these files over plain HTTPS with no auth.adelpro/atm-v2-int8-onnx.1import { pipeline } from '@huggingface/transformers';
2
3const extractor = await pipeline('feature-extraction', 'adelpro/atm-v2-web', {
4 dtype: 'q8',
5 device: 'wasm',
6});
7
8const out = await extractor('الرَّحْمَنُ عَلَّمَ الْقُرْآنَ', {
9 pooling: 'mean',
10 normalize: true,
11});
12// out.data is the 768-dim L2-normalized embedding.Note: the vector index built for this model uses mean pooling + L2 normalization with noquery:/passage:prefixes (the upstream model card shows plainencode(), not an E5-style prefix convention). Keep query and stored passages in the same unprefixed space. The WASM backend runs single-threaded to avoid SharedArrayBuffer / cross-origin isolation requirements.
1@article{nacar2025gate,
2 title={GATE: General Arabic Text Embedding for Enhanced Semantic Textual Similarity with Matryoshka Representation Learning and Hybrid Loss Training},
3 author={Nacar, Omer and Koubaa, Anis and Sibaee, Serry and Al-Habashi, Yasser and Ammar, Adel and Boulila, Wadii},
4 journal={arXiv preprint arXiv:2505.24581},
5 year={2025}
6}