CoolFace
Modelpublic

LoveJesus/biblical-glosser-chirho

sourceHugging Facemitupdated 7mo agoView on Hugging Face
0likes36downloads
Model Card

Biblical Interlinear Glosser (mT5-small)

For God so loved the world that he gave his only begotten Son, that whoever believes in him should not perish but have eternal life. - John 3:16

What This Does

This model produces word-by-word English glosses for biblical Hebrew and Greek verses, creating an interlinear translation.

Usage

python
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("LoveJesus/biblical-glosser-chirho")
model = AutoModelForSeq2SeqLM.from_pretrained("LoveJesus/biblical-glosser-chirho")

# Gloss Genesis 1:1
input_text = 'gloss [hebrew]: בְּרֵאשִׁית בָּרָא אֱלֹהִים אֵת הַשָּׁמַיִם וְאֵת הָאָרֶץ [GEN 1:1]'
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs, max_length=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# Expected: "In-beginning | created | God | [direct object marker] | the-heavens | and | the-earth"

# Gloss John 1:1
input_text = 'gloss [greek]: Ἐν ἀρχῇ ἦν ὁ λόγος [JHN 1:1]'
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs, max_length=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# Expected: "In | [the] beginning | was | the | Word"

Input Format

gloss [{language}]: {verse_text_in_original_script} [{verse_ref}]

Output Format

Word-by-word English glosses separated by | :

word1_gloss | word2_gloss | word3_gloss | ...

Training Data

  • —Macula Hebrew (Clear-Bible): ~23K OT verses with word-level glosses
  • —Macula Greek SBLGNT (Clear-Bible): ~8K NT verses with word-level glosses
  • —Total: ~31K verse-level glossing examples

Model Details

PropertyValue
Base modelgoogle/mt5-small (300M params)
ArchitectureEncoder-decoder (Seq2Seq)
LanguagesBiblical Hebrew, Koine Greek
Training8 epochs, lr=3e-4, batch=16
HardwareNVIDIA A100/H200 GPU

Limitations

  • —Glosses are word-level, not fluent English translations
  • —Based on Macula glossing conventions — may differ from other interlinear traditions
  • —Long verses (>30 words) may be truncated due to sequence length limits

Evaluation Results

Evaluated on a held-out test set of glossing examples.

MetricScore
BLEU22.06
Word Accuracy0.20
BLEU measures n-gram overlap between predicted and reference glosses. Word accuracy measures exact word-level match rate. Interlinear glossing is challenging because many Hebrew/Greek words have multiple valid English glosses, so these metrics represent a lower bound on actual quality.

Built with love for Jesus. Published by LoveJesus. Part of the bible.systems project.