Agentic translation demo using reflection workflow
Top 9.2% on SourcePulse
This project demonstrates an agentic workflow for machine translation using Large Language Models (LLMs), offering high customizability for style, idiom handling, and regional dialects. It targets researchers and developers interested in exploring LLM-based translation and its potential to improve upon traditional methods or generate training data.
How It Works
The core approach involves a three-step reflection workflow: LLM-driven translation, LLM-based self-critique and suggestion generation, and LLM-guided refinement of the translation. This iterative process allows for fine-grained control over translation output, such as specifying regional variations or adhering to custom glossaries, which is difficult with standard end-to-end MT systems.
Quick Start & Requirements
poetry install
and poetry shell
..env
file with OPENAI_API_KEY
is mandatory.import translation_agent as ta; translation = ta.translate(source_lang, target_lang, source_text, country)
examples/example_script.py
.Highlighted Details
gpt-4-turbo
, with suggestions to experiment with other LLMs.Maintenance & Community
This is a personal project by Andrew Ng, with contributions from Joaquin Dominguez, Nedelina Teneva, and John Santerre. It is presented as a demonstration to encourage discussion and contributions.
Licensing & Compatibility
Released under the MIT License, permitting commercial and non-commercial use, modification, and distribution.
Limitations & Caveats
The project is explicitly stated as "not mature software" and its performance can be inconsistent, sometimes worse than commercial offerings. Evaluation metrics like BLEU may not fully capture the quality improvements achieved by the agentic approach.
1 year ago
1+ week