Instructions to use kazalbrur/bangla-embed-e5-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use kazalbrur/bangla-embed-e5-small with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("kazalbrur/bangla-embed-e5-small") sentences = [ "সে একজন সুখী ব্যক্তি", "সে হ্যাপি কুকুর", "সে খুব সুখী মানুষ", "আজ একটি রৌদ্রোজ্জ্বল দিন" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Bangla-Embed-E5
A compact 118M Bengali sentence encoder for retrieval, semantic textual similarity, and
classification. Rebased from intfloat/multilingual-e5-small by three-stage distillation from a
BGE-M3 teacher (cross-lingual distillation → supervised contrastive fine-tuning → NLI polish).
On the official MTEB(Indic) Bengali subset it scores mean 0.666 and is a strong encoder in
the ≤120M tier. For romanized/cross-script (Banglish) retrieval, use the companion
kazalbrur/bangla-embed-e5-small-banglish.
Comparison — MTEB(Indic) Bengali subset
Main score per task type (mteb 2.12), single shared harness. This model is bolded.
| Model | Params | Retr | Class | Bitext-G | Bitext-C | Rerank | STS | Clust | Mean |
|---|---|---|---|---|---|---|---|---|---|
| BGE-M3 (teacher) | 568M | 0.644 | 0.879 | 0.874 | 0.722 | 0.852 | 0.593 | 0.340 | 0.700 |
| bangla-embed-e5-small-banglish | 118M | 0.791 | 0.832 | 0.826 | 0.654 | 0.840 | 0.596 | 0.349 | 0.698 |
| mE5-large | 560M | 0.631 | 0.847 | 0.876 | 0.748 | 0.852 | 0.540 | 0.339 | 0.690 |
| bangla-embed-e5-small (this model) | 118M | 0.572 | 0.848 | 0.832 | 0.668 | 0.840 | 0.554 | 0.349 | 0.666 |
| mE5-small (base) | 118M | 0.535 | 0.832 | 0.848 | 0.699 | 0.835 | 0.538 | 0.310 | 0.656 |
| LaBSE | 109M | 0.442 | 0.804 | 0.849 | 0.705 | 0.792 | 0.583 | 0.239 | 0.631 |
| Vyakyarth | 300M | 0.629 | 0.762 | 0.853 | 0.576 | 0.767 | 0.423 | 0.343 | 0.622 |
| pm-mpnet-base | 278M | 0.337 | 0.749 | 0.618 | 0.426 | 0.701 | 0.355 | 0.370 | 0.508 |
Retr=BelebeleRetrieval, Class=BengaliSentiment, Bitext-G/C=IN22 Gen/Conv,
Rerank=WikipediaReranking, STS=IndicCrosslingualSTS, Clust=SIB200. The top-3 means span only 0.010
and are statistically indistinguishable under a 7-task paired bootstrap (treat sub-0.02 gaps as
ties). This model improves over its mE5-small backbone (0.656 → 0.666) and leads the small-model
field on Bangla retrieval.
Usage
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("kazalbrur/bangla-embed-e5-small")
q = model.encode(["ঢাকা কোথায়?"], prompt_name="query", normalize_embeddings=True)
d = model.encode(["ঢাকা বাংলাদেশের রাজধানী।"], prompt_name="passage", normalize_embeddings=True)
print((q @ d.T)[0, 0])
This is an E5-family model: prefix queries with query: and passages with passage: (the
prompt_name argument above does this for you). Output dimension is 1024, L2-normalized.
Training & data
Three-stage curriculum (AdamW, cosine schedule, bf16). Distillation over ~18.7M EN–BN parallel pairs; supervised contrastive fine-tuning (MNR) on ~2.45M pairs (Bangla-native core + SWIM-IR + machine-translated MS MARCO-bn); NLI triplet polish (XNLI-bn). Released under the MIT license. Note that some training sources carry their own (in some cases non-commercial) terms — verify upstream data terms before commercial deployment.
Limitations
Standard Bangla only (regional varieties unrepresented); on full-corpus MIRACL-bn/Mr.TyDi-bn it trails larger models and the untuned backbone; all metrics are automatic. See the paper for full details.
- Downloads last month
- 147
Model tree for kazalbrur/bangla-embed-e5-small
Base model
intfloat/multilingual-e5-small