Skip to content
TenzinGayche edited this page Dec 17, 2025 · 2 revisions

Translation Workflow Wiki

Welcome to the Translation Workflow documentation! This project provides tools for translating Tibetan Buddhist texts using LLM-powered semantic analysis.


πŸ“š Table of Contents

Tibetan Translator Modules

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

UCCA Generator Module

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

πŸš€ Quick Start

Using Tibetan Translator (v1 - Commentary-based)

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])

Using Tibetan Translator V2 (Semantic-analysis-based)

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])

Using UCCA Generator

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)}")

πŸ—οΈ Project Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         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 Relationships

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

πŸ”§ Dependencies

  • langchain-anthropic - Claude LLM integration
  • langgraph - Workflow orchestration
  • pydantic - Data validation and models

πŸ“ Project Structure

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

πŸ”„ Version Comparison at a Glance

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.

Clone this wiki locally