A hybrid English ↔ Coptic (Bohairic / Sahidic) LLM translation system.
# Coptic Translator
A hybrid English ↔ Coptic (Bohairic / Sahidic) translation system.
Instead of relying purely on an LLM, this project combines:
- A **baseline neural translation model** (Hugging Face `megalaa/english-coptic-translator`
and `megalaa/coptic-english-translator`)
- A **structured lexicon and grammar layer**
- **Retrieval-augmented translation** grounded in real Coptic corpora
(e.g. Coptic SCRIPTORIUM)
- An **LLM refinement / validation pass**
- **Confidence scoring** based on dictionary coverage, corpus similarity,
and grammar validation — not just raw model confidence
See `ARCHITECTURE.md` for the full system design and phased roadmap.
## Status
Baseline translation, the FastAPI backend, structured lexicon (Phase 3),
corpus ingestion (Phase 4), retrieval (Phase 5), grammar checking (Phase 6),
and combined confidence scoring (Phase 7) are all implemented - see
`ARCHITECTURE.md` for how they fit together.
- [x] Repo scaffold
- [x] English → Bohairic / Bohairic → English translation (baseline model)
- [x] FastAPI backend (`backend/api/main.py`)
- [x] Structured lexicon + coverage scoring (Phase 3)
- [x] Corpus ingestion + keyword search (Phase 4)
- [x] Retrieval layer, keyword fallback when FAISS/sentence-transformers
aren't installed (Phase 5)
- [x] Grammar/surface-form validation (Phase 6)
- [x] Combined confidence scoring (Phase 7) - see `backend/validation/scorer.py`
- [x] Linked web interface - Translator, Lexicon, Manuscripts, and Lab Notes
pages, styled after Ancient Egyptian/Coptic textile and papyrus art,
served directly by the FastAPI app (Phase 8, in progress)
- [ ] Fine-tuning on curated parallel data (Phase 6 roadmap item)
- [ ] Real ingested Coptic SCRIPTORIUM corpus (currently just illustrative
sample sentences - see `data/corpus/README.md`)
A minimal Streamlit prototype (`frontend/app.py`) still exists as a quick
dev sanity-check for the raw `/translate` endpoint, but the linked
interface below is the primary UI now.
## Quickst …