andrewyng/translation-agent — explained in plain English
Analysis updated 2026-06-26
Translate documents with consistent terminology by supplying a custom glossary of required terms.
Get translations in a specific regional dialect, such as Mexican Spanish instead of Castilian Spanish.
Experiment with LLM self-reflection to improve translation quality beyond a single-pass approach.
Prototype a translation pipeline for a product that needs tone or style control.
| andrewyng/translation-agent | martinblech/xmltodict | klavis-ai/klavis | |
|---|---|---|---|
| Stars | 5,735 | 5,735 | 5,734 |
| Language | Python | Python | Python |
| Setup difficulty | easy | easy | moderate |
| Complexity | 2/5 | 1/5 | 3/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Python, Poetry, and an OpenAI API key. Install dependencies with Poetry, set your API key, then call the translate() function with source language, target language, optional country, and text.
This is a Python demonstration of a three-step translation workflow that uses a large language model to improve its own output. The process works like this: the model first translates a piece of text from one language to another, then it reads back its own translation and writes a list of suggestions for how to make it better, and finally it produces a revised translation using those suggestions. The idea is that this back-and-forth reflection can catch errors that a single-pass translation would miss. One practical advantage of this approach over traditional translation software is that you can steer the output in ways that are hard to do otherwise. You can include a glossary of terms that must be translated consistently, specify a writing style (formal or informal), or tell it to use a particular regional dialect, such as Mexican Spanish rather than Castilian Spanish. That kind of fine-grained control is difficult to get from a typical translation system. The project was created by Andrew Ng as a personal experiment over several weekends, with help from a few collaborators who assisted with code cleanup. The README notes clearly that this is not mature software and that performance measured against standard benchmarks is sometimes competitive with commercial services and sometimes worse. The goal of releasing it is to encourage experimentation and open-source contributions rather than to offer a production-ready tool. To run it yourself you need Python, the Poetry package manager, and an OpenAI API key. Once installed, calling the translate function takes a source language, a target language, an optional country for regional tuning, and the text to translate. The code is released under the MIT license.
A Python tool by Andrew Ng that translates text using a three-step LLM loop: initial translation, self-critique, then revised output. Supports glossaries, tone control, and regional dialects like Mexican Spanish. Experimental, not production-ready.
Mainly Python. The stack also includes Python, OpenAI API, Poetry.
MIT license, free to use, modify, and share for any purpose, including commercial projects.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.