Downloads · 30 days
16
14% of all-time downloads
johnlockejrr/marianmt_syr_voc_eastern
marianmt_syr_voc_eastern is a translation model from johnlockejrr. Use it when you need text moved from one language to another. The card lists the license as apache-2.0.
A fine-tuned MarianMT model for automatic Eastern Syriac (Mossul Bible) vocalization, converting consonantal (unvocalized) Syriac text to fully vocalized text with diacritical marks.
Downloads · 30 days
16
14% of all-time downloads
All-time downloads
115
Public
Parameters
239M
957 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors956 MB · 100%
From the Hugging Face model README
A fine-tuned MarianMT model for automatic Eastern Syriac (Mossul Bible) vocalization, converting consonantal (unvocalized) Syriac text to fully vocalized text with diacritical marks.
This model is fine-tuned from Helsinki-NLP/opus-mt-tc-bible-big-sem-en to perform Eastern Syriac vocalization—the task of adding diacritical marks (vowels) to consonantal Syriac text. The model is specifically trained on Eastern Syriac texts, and is optimized for the Eastern Syriac vocalization system.
>>syr_cons<<) to vocalized Eastern Syriac (>>syr_voc<<)Helsinki-NLP/opus-mt-tc-bible-big-sem-en>>syr_cons<< (consonantal Syriac)>>syr_voc<< (vocalized Eastern Syriac)from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("johnlockejrr/marianmt_syr_voc_eastern")
model = AutoModelForSeq2SeqLM.from_pretrained("johnlockejrr/marianmt_syr_voc_eastern")
# Input: consonantal Syriac text
text = "ܒܪܫܝܬ ܐܝܬܘܗܝ ܗܘܐ ܡܠܬܐ"
# Add language tag
input_text = f">>syr_cons<< {text}"
# Tokenize
inputs = tokenizer(input_text, return_tensors="pt", padding=True, truncation=True, max_length=512)
# Generate
outputs = model.generate(**inputs, max_length=512, num_beams=4, length_penalty=0.6)
# Decode
vocalized = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(vocalized)
from transformers import pipeline
vocalizer = pipeline("text2text-generation",
model="johnlockejrr/marianmt_syr_voc_eastern",
tokenizer="johnlockejrr/marianmt_syr_voc_eastern")
# Input text (consonantal)
text = "ܒܪܫܝܬ ܐܝܬܘܗܝ ܗܘܐ ܡܠܬܐ"
input_text = f">>syr_cons<< {text}"
# Vocalize
result = vocalizer(input_text, max_length=512, num_beams=4, length_penalty=0.6)
print(result[0]['generated_text'])
The model expects input text to be normalized to NFC (Normalization Form Composed) Unicode format. The model automatically handles this, but for best results, ensure your input text is properly normalized:
import unicodedata
def normalize_text(text: str) -> str:
"""Normalize text to NFC format."""
return unicodedata.normalize("NFC", text)
# Normalize input before processing
text = normalize_text("ܒܪܫܝܬ ܐܝܬܘܗܝ")
For optimal results, input text should contain only consonantal Syriac characters. The model is designed to work with raw consonantal text, but it can handle text with some punctuation. For best performance, remove vocalization marks from input text if present.
Recommended generation parameters:
>>syr_cons<< and >>syr_voc<<) added to tokenizer vocabulary{
"learning_rate": 1e-5,
"batch_size": 4,
"gradient_accumulation_steps": 4,
"num_epochs": 100,
"max_input_length": 512,
"max_target_length": 512,
"warmup_steps": 1000,
"weight_decay": 0.01,
"eval_steps": 1000,
"save_steps": 1000,
"save_total_limit": 3
}
The model is evaluated using three metrics:
| Metric | Validation (Best) | Test (Final) |
|---|---|---|
| BLEU | 63.04 | 62.41 |
| chrF | 88.19 | 87.98 |
| Char Acc | 57.84% | 58.81% |
| Loss | 0.0769 | 0.0782 |
If you use this model, please cite:
@misc{marianmt_syr_voc_eastern,
title={MarianMT Eastern Syriac Vocalization Model},
author={johnlockejrr},
year={2025},
howpublished={\url{https://huggingface.co/johnlockejrr/marianmt_syr_voc_eastern}},
note={Fine-tuned from Helsinki-NLP/opus-mt-tc-bible-big-sem-en. Trained on Eastern Syriac Bible texts (Mossul) and Digital Syriac Corpus texts.}
}
For questions, issues, or contributions, please open an issue on the model repository.
This model is released under the Apache 2.0 license, consistent with the base model.