Instructions to use harshbheem/kreol-bhojpuri-translator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use harshbheem/kreol-bhojpuri-translator with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="harshbheem/kreol-bhojpuri-translator")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("harshbheem/kreol-bhojpuri-translator") model = AutoModelForSeq2SeqLM.from_pretrained("harshbheem/kreol-bhojpuri-translator", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Kreol Morisien β Bhojpuri Morisien (Romanized) Translator
Model Description
This repository contains a fine-tuned multilingual sequence-to-sequence translation model built using Hugging Face Transformers. It translates Kreol Morisien (Latin script) to Bhojpuri Morisien (romanized, Latin script).
Language Pair
- Source (NLLB tag):
mfe_Latn - Target (NLLB tag):
bho_Latn
Fixed Decoding Configuration (IMPORTANT)
All evaluations and demos use the same decoding configuration:
num_beams = 6no_repeat_ngram_size = 3length_penalty = 1.0max_length = 96early_stopping = True
Language forcing:
tokenizer.src_lang = "mfe_Latn"tokenizer.tgt_lang = "bho_Latn"forced_bos_token_id = tokenizer.convert_tokens_to_ids("bho_Latn")
Evaluation
Metrics computed using sacrebleu on a fixed test split:
- BLEU: 38.55
- chrF: 58.89
Usage Example
import torch
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
repo_id = "harshbheem/kreol-bhojpuri-translator"
tokenizer = AutoTokenizer.from_pretrained(repo_id, use_fast=False)
model = AutoModelForSeq2SeqLM.from_pretrained(repo_id)
tokenizer.src_lang = "mfe_Latn"
tokenizer.tgt_lang = "bho_Latn"
tgt_id = tokenizer.convert_tokens_to_ids("bho_Latn")
decode_kwargs = dict(
num_beams=6,
no_repeat_ngram_size=3,
length_penalty=1.0,
max_length=96,
early_stopping=True,
forced_bos_token_id=tgt_id,
)
text = "mo pe al lekol"
inputs = tokenizer(text, return_tensors="pt")
with torch.inference_mode():
output = model.generate(**inputs, **decode_kwargs)
print(tokenizer.decode(output[0], skip_special_tokens=True))
Limitations
- Output quality depends on training data coverage and consistency.
- This is a research prototype for academic demonstration; it may produce grammatical errors.
- CPU inference (e.g., free Spaces) may be slower than GPU.
Citation
Harsh Bheem. (2026). Kreol Morisien β Bhojpuri Morisien Neural Machine Translation (Undergraduate dissertation project).
- Downloads last month
- 10