Run this model with HF Jobs
Run jafrilalam/bohuswar-embed on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/jafrilalam/bohuswar-embed. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/jafrilalam/bohuswar-embed on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use jafrilalam/bohuswar-embed with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use jafrilalam/bohuswar-embed with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("jafrilalam/bohuswar-embed") sentences = [ "সে একজন সুখী ব্যক্তি", "সে হ্যাপি কুকুর", "সে খুব সুখী মানুষ", "আজ একটি রৌদ্রোজ্জ্বল দিন" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Download README.md from jafrilalam/bohuswar-embed: direct link, hf CLI and curl.
- Browser
- Download file 6.46 kB
-
https://huggingface.co/jafrilalam/bohuswar-embed/resolve/main/README.md
- Command line
-
hf download hf://jafrilalam/bohuswar-embed/README.md
-
curl -L -o README.md https://huggingface.co/jafrilalam/bohuswar-embed/resolve/main/README.md
language:
- bn
license: apache-2.0
base_model: Qwen/Qwen3-Embedding-0.6B
library_name: sentence-transformers
pipeline_tag: sentence-similarity
tags:
- bengali
- bangla
- dialect
- romanized-bengali
- banglish
- information-retrieval
- sentence-transformers
Bohuswar Embed (বহুস্বর)
A Bengali sentence embedding model for search across regional dialects. You can type a query in Chittagonian, Sylheti, Noakhali, Barishal or Mymensingh Bangla, in Bengali script or in Latin letters (Banglish), and it finds the matching text written in standard Bangla.
It is Qwen/Qwen3-Embedding-0.6B, fully fine-tuned on dialect-to-standard sentence pairs.
Companion reranker: jafrilalam/bohuswar-reranker. For most uses you do not need it (see the results below).
What it is for
- Search over a Bangla document collection when users write the way they speak, for example a helpline FAQ, a government service portal or a news archive.
- Matching romanized Bangla (
tomar abbu kemon ache) to Bengali-script text (তোমার আব্বু কেমন আছে?). - Finding near-duplicate or same-meaning sentences across dialects, for example when you group user messages or clean a dataset.
- The retrieval step of a RAG system whose documents are in standard Bangla.
It is not a translation model. It does not convert dialect text into standard Bangla. It only places sentences with the same meaning close together.
How to use
pip install -U sentence-transformers
Queries need the saved query prompt. Documents are encoded as plain text with no prompt.
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("jafrilalam/bohuswar-embed")
docs = [
"তোমার আব্বু কেমন আছে?",
"আমার বড় বোনের আজকে মন ভালো নেই",
"তুমি কি আমাকে এই কাজটি করে দিতে পারবে?",
]
queries = [
"তোয়ার আব্বু কেন আসে?", # Chittagonian, Bengali script
"mor boro buiner aijgo mon valo nai", # Barishal, romanized
]
doc_emb = model.encode(docs)
query_emb = model.encode(queries, prompt_name="query")
scores = model.similarity(query_emb, doc_emb)
print(scores)
for q, row in zip(queries, scores):
print(q, "->", docs[int(row.argmax())])
If you write your own pipeline, the query prompt is:
Instruct: Given a Bengali dialect or romanized Bengali query, retrieve relevant text written in standard Bengali.
Query:
Tips:
- Use the model alone. In our tests, adding BM25 with rank fusion made results much worse, because BM25 cannot match romanized queries against Bengali-script text.
- Long documents: split them into short passages of 1 to 3 sentences. The model was trained with a 192-token limit on short sentences.
- Apply Unicode NFC normalization to queries and documents before encoding.
Results
Task: for each dialect query, find its standard Bangla sentence among 2,507 candidates. Test meanings were never seen in training. Mymensingh was removed from training completely, so it shows how the model handles a dialect it has never seen.
MRR@10, test set (about 250 queries per row):
| Dialect | Script | Base Qwen3-Embedding-0.6B | Bohuswar Embed |
|---|---|---|---|
| Barishal | Bengali | 0.767 | 0.980 |
| Barishal | Romanized | 0.219 | 0.977 |
| Chittagong | Bengali | 0.544 | 0.974 |
| Chittagong | Romanized | 0.210 | 0.969 |
| Noakhali | Bengali | 0.751 | 0.985 |
| Noakhali | Romanized | 0.225 | 0.983 |
| Sylhet | Bengali | 0.772 | 0.988 |
| Sylhet | Romanized | 0.251 | 0.979 |
| Mymensingh (unseen) | Bengali | 0.909 | 0.995 |
| Mymensingh (unseen) | Romanized | 0.321 | 0.992 |
Overall:
| System | Test R@1 | Test MRR@10 | Unseen-dialect MRR@10 |
|---|---|---|---|
| BM25 | 0.267 | 0.301 | 0.439 |
| Base Qwen3-Embedding-0.6B | 0.404 | 0.467 | 0.617 |
| Base Qwen3 + base bge-reranker-v2-m3 | 0.477 | 0.537 | 0.668 |
| Bohuswar Embed | 0.966 | 0.979 | 0.994 |
| Bohuswar Embed + Bohuswar Reranker | 0.968 | 0.980 | 0.991 |
A cluster bootstrap over meanings (2,000 resamples) gives a test MRR@10 gain of +0.44 over the base pipeline, with a 95% interval of 0.41 to 0.47.
Most remaining errors put the correct sentence at rank 2. Many of these are near-duplicate standard sentences in the corpus (for example, the same sentence with a spelling variant), so the true error rate is a little lower than shown. Chittagonian is the hardest dialect.
Training
- Data: Vashantor parallel corpus (dialect sentence, standard Bangla sentence), Bengali script and romanized. 15,923 training pairs from Barishal, Chittagong, Noakhali and Sylhet. Data was split by meaning, so no standard sentence appears in both train and test.
- Text cleaning: NFC normalization, khanda-ta unification, removal of zero-width characters (ZWJ/ZWNJ kept). Dialect spelling was not changed.
- Loss: CachedMultipleNegativesRankingLoss with in-batch negatives and 3 hard negatives per pair (mined from ranks 10 to 30 of the base model). The sampler avoids duplicates in a batch.
- Settings: 1 epoch, learning rate 1e-5, batch size 32, max length 192, Adafactor, fp16, seed 42.
- Hardware: one NVIDIA T4, about 2.5 hours.
Limitations
- Trained and tested on one dataset of short, conversational sentences. Scores on long passages or real search queries will be lower. They have not been measured yet.
- Covers five dialects. Others (Rangpur, Rajshahi, Khulna and so on) are untested.
- Mymensingh is close to standard Bangla, so the unseen-dialect score in Bengali script is a mild test. The romanized result (0.321 to 0.992) is the stronger evidence.
- It may confuse pronoun and politeness forms (তুই / তুমি, তারা / তিনি) and rare dialect words.
- Performance on standard Bangla to standard Bangla retrieval after fine-tuning has not been checked.
- Results come from a single training run.
- Check the Vashantor license terms before any commercial use.
Versions
Every upload is tagged. The current sentence-level checkpoint is tag sentence-1619d1f10d8d. Pin it with SentenceTransformer("jafrilalam/bohuswar-embed", revision="sentence-1619d1f10d8d").