Downloads · 30 days
14
29% of all-time downloads
johnlockejrr/marianmt-smp-sam
marianmt-smp-sam 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.
This is a bidirectional translation model fine-tuned from Helsinki-NLP/opus-mt-sem-sem for translating between Samaritan Hebrew (smp) and Samaritan Aramaic (sam). The model supports both translation directions using s…
Downloads · 30 days
14
29% of all-time downloads
All-time downloads
48
Public
Parameters
61.4M
247 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors246 MB · 97%
From the Hugging Face model README
This is a bidirectional translation model fine-tuned from Helsinki-NLP/opus-mt-sem-sem for translating between Samaritan Hebrew (smp) and Samaritan Aramaic (sam). The model supports both translation directions using special language tags (>>smp<< and >>sam<<).
The model is based on the Marian architecture and was fine-tuned specifically for the Samaritan Hebrew-Aramaic language pair, which are closely related Semitic languages written in the Hebrew script.
>>smp<< and >>sam<<)The dataset contains parallel biblical texts in Samaritan Hebrew and Samaritan Aramaic (Targumic), with both directions included in the training data to enable bidirectional translation.
Training was conducted with:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("johnlockejrr/marianmt-smp-sam")
model = AutoModelForSeq2SeqLM.from_pretrained("johnlockejrr/marianmt-smp-sam")
# Translate from Samaritan Hebrew to Samaritan Aramaic
text_smp = "אחר הדברים האלה היה דבר יהוה אל אברם"
input_text = f">>smp<< {text_smp}"
inputs = tokenizer(input_text, return_tensors="pt", max_length=313, truncation=True)
outputs = model.generate(**inputs, max_length=313, num_beams=4, length_penalty=0.6)
translation = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(translation)
# Translate from Samaritan Aramaic to Samaritan Hebrew
text_sam = "בתר ממלליה אלין הוה מלל יהוה עם אברם"
input_text = f">>sam<< {text_sam}"
inputs = tokenizer(input_text, return_tensors="pt", max_length=313, truncation=True)
outputs = model.generate(**inputs, max_length=313, num_beams=4, length_penalty=0.6)
translation = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(translation)
The model can also be used with the provided inference script (if available in the repository):
python inference_smp_sam.py \
--model_path johnlockejrr/marianmt-smp-sam \
--text "אחר הדברים האלה היה דבר יהוה אל אברם" \
--direction smp2sam
The model uses special language tags to indicate translation direction:
>>smp<< - Prefix for Samaritan Hebrew (source) → Samaritan Aramaic (target)>>sam<< - Prefix for Samaritan Aramaic (source) → Samaritan Hebrew (target)These tags must be included at the beginning of the input text for proper direction control.
If you use this model, please cite:
@misc{marianmt-smp-sam,
title={MarianMT Model for Samaritan Hebrew ↔ Samaritan Aramaic Translation},
author={johnlockejrr},
year={2025},
howpublished={\url{https://huggingface.co/johnlockejrr/marianmt-smp-sam}}
}
For questions, issues, or contributions, please refer to the model repository.