Embeddings

Open Persian Text Embedding Models

Open Persian (Farsi) text embedding models for semantic search, retrieval, reranking, clustering and sentence similarity. They are trained on Shiraz, evaluated on the full FaMTEB benchmark, and load with sentence-transformers in two lines of Python.

Models

Every model is evaluated on all 52 tasks of FaMTEB (MTEB(fas, v2)), so scores are directly comparable.

ModelParametersDimensionsMax tokensFaMTEB (task mean)License
Noql11.9M768 → 6451258.21Apache 2.0

Noql

(نُقل)

A tiny and efficient Persian text embedding model. Noql has only 12M parameters and is trained with Matryoshka representation learning, so its 768-dimensional embeddings can be truncated to 512, 256, 128 or 64 dimensions with little loss in quality.

11.9M
Parameters
768
Dimensions (Matryoshka to 64)
512
Max sequence length (tokens)
58.21
FaMTEB mean, 52 tasks

Usage

$pip install -U sentence-transformers
from sentence_transformers import SentenceTransformer model = SentenceTransformer("shekar-ai/Noql") sentences = [ "پایتخت ایران تهران است.", "تهران بزرگ‌ترین شهر ایران است.", "امروز هوا بارانی است.", ] embeddings = model.encode(sentences) print(model.similarity(embeddings, embeddings)) # tensor([[1.0000, 0.8143, 0.3462], # [0.8143, 1.0000, 0.2109], # [0.3462, 0.2109, 1.0000]])

Retrieval

query = "بهترین زمان برای سفر به شیراز چه موقع است؟" documents = [ "بهار به دلیل هوای معتدل و شکوفه‌های نارنج بهترین فصل سفر به شیراز است.", "قیمت طلا در بازار امروز کاهش یافت.", "حافظیه و سعدیه از جاذبه‌های معروف شیراز هستند.", ] scores = model.similarity(model.encode(query), model.encode(documents)) print(scores) # tensor([[0.8091, 0.0271, 0.5199]])

Smaller embeddings

model = SentenceTransformer("shekar-ai/Noql", truncate_dim=256) embeddings = model.encode(documents) # shape: (3, 256)

Evaluation

Results on FaMTEB (MTEB(fas, v2), all 52 tasks) at each embedding size.

Metric76851225612864
Mean (task)58.2157.9757.5456.9655.61
Mean (type)61.6361.4661.1260.7259.66
% of 768 score100%99.6%98.8%97.9%95.5%
Storage per vector (fp32)3,072 B2,048 B1,024 B512 B256 B
Task typeTasks76851225612864
Retrieval1747.2047.1946.8046.0743.87
Reranking264.1664.2263.7763.6163.09
Pair Classification779.9479.9880.0380.0479.97
Classification1658.9858.4457.5656.6755.29
Clustering560.4859.4760.0859.7660.06
STS271.3771.4071.3271.2571.19
Bitext Mining349.2449.5248.3147.6544.15

Training

Noql was trained on Shiraz in two stages, each on 2M random samples:

  1. Positive pairs: query–document pairs with in-batch negatives.
  2. Hard negatives: half positive pairs, half pairs with mined hard negatives.

Use Cases

Semantic Search Retrieval-Augmented Generation (RAG) Reranking Clustering Sentence Similarity Duplicate Detection Text Classification Features

Frequently Asked Questions

What Persian embedding models does Shekar AI provide?

Shekar AI publishes open Persian (Farsi) text embedding models on Hugging Face. The current model is Noql, a 12M-parameter sentence embedding model released under Apache 2.0.

How do I use Noql?

Install sentence-transformers and load it with SentenceTransformer("shekar-ai/Noql"). model.encode() returns 768-dimensional, L2-normalized embeddings, and model.similarity() computes cosine similarity.

How well does Noql perform?

On FaMTEB (MTEB(fas, v2), all 52 tasks) Noql scores 58.21 mean per task and 61.63 mean per task type at 768 dimensions, with 47.20 on retrieval, 79.94 on pair classification and 71.37 on STS.

Can I use smaller Noql embeddings?

Yes. Noql is trained with Matryoshka representation learning, so its embeddings can be truncated to 512, 256, 128 or 64 dimensions with SentenceTransformer("shekar-ai/Noql", truncate_dim=256). At 256 dimensions it keeps 98.8% of its full FaMTEB score at a third of the storage (1,024 bytes per fp32 vector).

What was Noql trained on?

Noql was trained on Shiraz, Shekar AI's quality-filtered Persian web corpus, in two stages of 2M samples each: query–document pairs with in-batch negatives, then a mix of positive pairs and mined hard negatives. It starts from a Persian ALBERT-base model.

Can I use Noql commercially?

Yes. Noql is released under the Apache License 2.0, which permits commercial use, modification and redistribution.

Other Shekar AI Projects

Links