Repository navigation
Home
TenzinGayche edited this page Dec 17, 2025
·
2 revisions
Welcome to the Translation Workflow documentation! This project provides tools for translating Tibetan Buddhist texts using LLM-powered semantic analysis.
The main translation pipeline with two versions - commentary-based (v1) and semantic-analysis-based (v2).
| Page | Description |
|---|---|
| Tibetan-Translator-Comparison | Key differences between v1 and v2 |
| Tibetan-Translator-V1 | Commentary-based translation workflow |
| Tibetan-Translator-V2 | UCCA + Word-by-Word + Summary based workflow |
| Translator-Prompts | All prompt templates for translation |
| Translator-Models | Pydantic models for translation |
The UCCA (Universal Conceptual Cognitive Annotation) Generator creates semantic graph representations of Tibetan Buddhist texts.
| Page | Description |
|---|---|
| UCCA-Generator-Overview | Architecture and module overview |
| Data-Models | Pydantic models (UCCANode, UCCAGraph, State, etc.) |
| UCCA-Agent-Workflow | LangGraph iterative generation-evaluation workflow |
| Prompts | Key prompt templates for generation and evaluation |
| API-Reference | Function and class documentation |
from tibetan_translator import optimizer_workflow
state = {
"source": "ΰ½ΰ½Όΰ½ΰΌΰ½ΰΎ±ΰ½²ΰΌΰ½ΰ½¦ΰΎ‘ུΰ½ΰΌΰ½ΰΌΰ½ ΰ½ΰ½΄ΰ½",
"sanskrit": "Sanskrit text",
"commentary1": "Commentary 1...",
"commentary2": "Commentary 2...",
"commentary3": "Commentary 3...",
"language": "English",
# ... other fields
}
result = optimizer_workflow.invoke(state)
print(result["translation"][-1])from tibetan_translator_v2 import optimizer_workflow
state = {
"source": "ΰ½ΰ½Όΰ½ΰΌΰ½ΰΎ±ΰ½²ΰΌΰ½ΰ½¦ΰΎ‘ུΰ½ΰΌΰ½ΰΌΰ½ ΰ½ΰ½΄ΰ½",
"sanskrit": "Sanskrit text",
"ucca": "UCCA graph analysis...",
"word_by_word": "Word-by-word translation...",
"multilevel_summary": "Multi-level summary...",
"language": "English",
# ... other fields
}
result = optimizer_workflow.invoke(state)
print(result["translation"][-1])from ucca_generator.ucca_generator import run_ucca_generation_pipeline
result = run_ucca_generation_pipeline("ΰ½ΰ½²ΰΌΰ½’ΰΎΰ½ΰΌΰ½ΰΌΰ½¦ΰΎΰ½Όΰ½ΰΌΰ½ΰΌΰ½£ΰΌΰ½ΰ½ΰ½Όΰ½¦ΰΌΰ½ΰΌΰ½
ΰ½²ΰΌΰ½‘ΰ½Όΰ½ΰΌ")
if result['ucca_graph']:
print(f"Root ID: {result['ucca_graph'].root_id}")
print(f"Nodes: {len(result['ucca_graph'].nodes)}")βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Translation Workflow Project β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββββββ βββββββββββββββββββββββ β
β β tibetan_translator β β tibetan_translator β β
β β (v1) β β (v2) β β
β β β β β β
β β Commentary-based β β Semantic-based β β
β β β’ 3 commentaries β β β’ UCCA graphs β β
β β β’ Traditional β β β’ Word-by-word β β
β β β β β’ Multi-level sum β β
β βββββββββββ¬ββββββββββββ ββββββββββββ¬βββββββββββ β
β β β β
β β ββββββββββββββββββββ β
β β β β
β β βΌ β
β β βββββββββββββββββββββββ β
β β β ucca_generator βββββββββββββββββββββββββββββββββββββ β
β β β β β β
β β β β’ UCCA parsing β βββββββββββββββββββββββ β β
β β β β’ Graph generation β β word_by_word_ β β β
β β β β’ Evaluation loop β β generator β β β
β β βββββββββββββββββββββββ βββββββββββββββββββββββ β β
β β β β β
β βββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Module | Purpose | Dependencies |
|---|---|---|
tibetan_translator (v1) |
Commentary-based translation | Standalone |
tibetan_translator_v2 |
Semantic-analysis translation | Uses outputs from ucca_generator, word_by_word_generator |
ucca_generator |
UCCA semantic graph generation | Standalone |
word_by_word_generator |
Word-by-word translations | Standalone |
-
langchain-anthropic- Claude LLM integration -
langgraph- Workflow orchestration -
pydantic- Data validation and models
translation-workflow/
βββ tibetan_translator/ # V1: Commentary-based translation
β βββ cli.py # Command-line interface
β βββ config.py # Configuration settings
β βββ models.py # Pydantic models
β βββ prompts.py # Prompt templates
β βββ utils.py # Utilities and LLM setup
β βββ workflow.py # LangGraph workflow
β βββ processors/ # Processing functions
β βββ commentary.py # Commentary translation
β βββ translation.py # Translation generation
β βββ evaluation.py # Quality evaluation
β βββ formatting.py # Format checking
β βββ glossary.py # Glossary extraction
β
βββ tibetan_translator_v2/ # V2: Semantic-analysis based
β βββ (same structure as v1)
β
βββ ucca_generator/ # UCCA graph generation
β βββ models.py
β βββ workflow.py
β βββ ucca_agent.py
β βββ ucca_generator.py
β
βββ word_by_word_generator/ # Word-by-word translation
βββ generator.py
| Aspect | tibetan_translator (v1) | tibetan_translator_v2 |
|---|---|---|
| Input Source | Raw commentaries | Pre-processed semantic data |
| Processing | Translates commentaries in parallel | Loads UCCA/word-by-word/summary |
| Philosophy | Commentary-driven | Semantic-analysis-driven |
| Dependencies | Standalone | Requires ucca_generator output |
| Best For | Traditional scholarly texts | Detailed linguistic analysis |
See Tibetan-Translator-Comparison for detailed differences.