Language models
& semantic search

Our work includes trained translation and transliteration models, plus retrieval systems that use embeddings from existing providers. Each addresses a different part of reading or searching a collection.

Working across languages and scripts

Hadith translation involves names, chains of narration, and terms that need consistent handling. We prepared parallel text and trained models on it. Translation output still needs review against the original passage.

Five translation directions and a transliteration tool are described below. Our embedding-based projects retrieve source passages instead of translating them; their model providers and index dimensions are listed separately.

~18 lakh Matched Hadith lines used for translation training (about 1.8 million pairs)
6 models Five language directions plus one lightweight transliterator
Made here Language data prepared and models trained at QASRA

What is a training pair?

One Hadith, written two ways

A training pair contains the same passage in a source language and a target language. The model learns from many such examples.

First language Hadith text in Urdu or Arabic
↔
Second language The same meaning in Hindi, English, and so on

When we say about 18 lakh pairs, we mean nearly 18 lakh (1.8 million) of these matched Hadith lines. The model learns from that pile, the way a student learns by reading many examples.

The wording of names, chains, and specialist terms matters in this material. Preparing and checking the matched text is part of the training work.

What we have trained so far

Five ways to move Hadith text from one language to another, and one light tool for script and spelling help.

01
Urdu to Hindi

Urdu to Hindi

Takes Urdu Hadith and puts it into Hindi (Devanagari) so readers who use Hindi script can follow the meaning more easily.

QASRA
02
Urdu to English

Urdu to English

Turns Urdu Hadith into clear English for students, teachers and anyone who studies in English.

QASRA
03
Arabic to Urdu

Arabic to Urdu

Translates Arabic Hadith text into Urdu for readers studying the source material.

QASRA
04
Arabic to English

Arabic to English

Goes straight from Arabic to English, without needing Urdu in the middle. Useful for study and wider sharing.

QASRA
05
Urdu to Arabic

Urdu to Arabic

Produces Arabic text from Urdu input for comparison and study.

QASRA
06
Light tool

Transliterator

Converts Urdu and Arabic input into Hindi or Roman output. The available bundles use ONNX Runtime for inference.

QASRA

Recorded training runs

We fine-tuned existing models, including NLLB and mT5 variants, on our prepared Hadith pairs. Loss measures prediction error under a particular training setup. It is useful for following a run, but it does not directly measure whether a translation is accurate.

The Arabic-to-Urdu run recorded a starting loss of 8.88 and a final evaluation loss of 1.188. Other runs used different models or data. Their figures should be read within each setup, rather than used as a ranking of language directions or providers.

Model (example runs) What we used Start loss Final eval loss Steps / notes
Arabic to Urdu NLLB-200 (600M), re-trained on Hadith 8.88 1.188 About 14,589 steps. Loss fell step by step (1.45 → 1.34 → 1.28 → 1.24 → 1.21 → 1.19). No wild spikes.
Urdu to Hindi mT5-Small (300M), re-trained 17.45 0.236 About 11,931 steps (1 epoch on that run). By step 2,000 already ~0.45; then settled near 0.24.
Urdu to Hinglish / Roman mT5-Small (300M), re-trained 19.03 0.381 About 11,931 steps. Steady drop, then stable after ~10,000 steps.
Later NLLB Hadith runs NLLB-200 distilled 600M on Hadith ~1.27 (early train) 0.15–0.18 Urdu–Hindi eval ~0.15; Urdu–Hinglish eval ~0.18 after full epoch on GPU (A100 / A6000 class machines in our logs).

An epoch is one pass over the training data. Evaluation checks during a run help track progress, but loss alone does not establish generalisation or publication quality. A comparison between models needs the same test material, evaluation method, and a review of actual output.

Hindi and Roman output from Urdu and Arabic text

The transliterator converts script and phonetic forms. It is intended to keep names and complete word forms readable. The two available output bundles are Hindi (Devanagari) and Hinglish (Roman script).

Bundles

What the model needs to run

Both bundles contain a Transformer encoder and a decoder exported to ONNX, along with tokenizers and inference scripts. They run with ONNX Runtime, SentencePiece, and NumPy; the inference scripts do not require a full training framework.

Each bundle has about 171 MB of external encoder and decoder weights, excluding the tokenizer and small graph files. This is the weight-file size, not a measurement of runtime memory or a comparison with another model.

Spelling

Keep complete word forms

A name or technical term needs a spelling that a reader can recognise and search for. For example, takhallus (تخلّص), a pen-name, is more useful in a catalogue than the shortened Roman form tkhls.

Words such as sheer and shair also need attention to context. The Urdu شیر can mean lion or milk; شاعر means poet. Check ambiguous words against the source, especially in passages prepared for publication.

Review

Check the converted passage

Review names, specialist terms, missing words, and unintended changes of language. A readable conversion can still contain an error. Keep the original text available wherever the output will be used for research or teaching.

Access

Using the bundles

Contact support@qasra.org about model access or integration. Tell us which script you need, the type of text you are converting, and whether the model will run locally or in an application.

Made and checked by people at QASRA

Training included data preparation, evaluation checkpoints, and changes to numerical precision where needed. For example, mT5 runs used bf16 after fp16 instability.

Hadith data

The translation runs used matched Hadith text prepared by QASRA.

Re-train, then check

Each model was re-trained, tested every few thousand steps, and saved when loss and output looked right to the team.

Light where it helps

The transliterator has a bounded script-conversion task and can run from the supplied ONNX bundles.

Finding passages related to a question

An embedding represents text as a numerical vector. A search system compares a question’s vector with the vectors of stored passages to find related material. QASRA builds the collection, index, and retrieval application around existing embedding models.

Hadith retrieval with Voyage

Uses Voyage-4-large at 2,048 dimensions. The current index contains about 703,000 records, with category metadata that connects search results to the original Hadith records.

Hadith retrieval with OpenAI embeddings

Uses text-embedding-3-large at 3,072 dimensions. This is a separate index of about 703,000 records. The two indexes differ slightly in record count; they should be evaluated separately.

Quran and Tafseer search

Separate retrieval projects use Voyage embeddings for selected Quran translations and Tafseer passages. Search results are read with their source text and references.

Retrieval and answer generation

Finding a passage and writing an answer are separate operations. The Hadith systems can return source records, optionally rerank candidates, and use retrieved material to support an AI-generated answer.

Access and evaluation

These are QASRA retrieval systems using provider models, separate from our trained translation models and the public library MCP endpoint. Contact support@qasra.org about access or a suitable evaluation for your collection. More dimensions alone do not establish better search quality.

Public library MCP setup

Questions about this work?

For model access, retrieval evaluation, or a software integration, email support@qasra.org. Include your languages, the type of data, and the application you are building.

Phone

+91 7737378656 · +91 9529175756

Email

support@qasra.org

Email your enquiry

Describe your project, the material or software involved, and any deadline. For integrations, include your platform and expected usage.

Email support@qasra.org

You can also use the contact form on our home page.