Training and exploration of ancient greek and latin PatriBERT models (LLM specialized on Church Fathers literature).
This repository contains scripts and notebooks for:
- Domain-adaptive pretraining of BERT models on Latin and Ancient Greek corpora
- Fine-tuning/evaluation workflows
- Attention and hidden-state exploration with BertViz
The goal is to build and analyze PatriBERT variants specialized for patristic literature.
BERT_pretraining.py— generic pretraining workflowLatin-PatriBERT_training.py— Latin model adaptation/training pipelineGreek-PatriBERT_training.py— Ancient Greek model adaptation/training pipelinePatriBERT_finetuning.py— downstream fine-tuning script
BertViz_Latin-PatriBERT.ipynb— tokenization, hidden states, and attention visualizationArchives/— archived notebooks and experiments
processed_corpus/latin_corpus.txtprocessed_corpus/latin_corpus_i&u.txtprocessed_corpus/greek_corpus_unaccented.txtprocessed_corpus/greek_patristic_corpus_deaccented.txtprocessed_corpus/VG.tsv
model/— exported/finalized model directorieslatin-bert-adapted/— training checkpoints from adaptation runs
- Prepare corpus files in
processed_corpus/. - Run language-specific training (
Latin-PatriBERT_training.pyorGreek-PatriBERT_training.py). - Save/adapt checkpoints and export final model to
model/. - Use
BertViz_Latin-PatriBERT.ipynbfor qualitative analysis of tokenizer behavior, hidden states, and attention. - Run
PatriBERT_finetuning.pyfor downstream tasks.
- Training scripts are designed around Hugging Face
transformers+datasets. - Existing checkpoints and model folders are included for reproducibility and comparison across runs.