Backend for language access translation services.
Prerequisites:
- Python 3.13
- Poetry
- AWS credentials with access to the following services:
- Translate
- Bedrock Runtime (must have access to Anthropic Claude enabled)
Install dependencies by running poetry install.
To run the demo (CLI tool), first create a directory with a single file named source.txt that contains English text to translate.
This is the minimum requirement for running the tool.
Note
Before running translations, your environment needs to be authenticated with AWS.
poetry run python -m src.cli translate ./samples/test1 en es-MX
This will perform the following actions:
-
Translate the English text in
samples/test1/source.txtto Mexican Spanish using Amazon Translate and save the result tosamples/test1/es-MX/translation.txt. Note: If a file already exists atsamples/test1/es-MX/translation.txt, this step will be skipped. -
Generate an assessment of the translation in
samples/test1/es-MX/translation.txtusing Claude (via Amazon Bedrock) and save the assessment JSON tosamples/test1/es-MX/assessment-DATETIME/assessment.json(note:DATETIMEwill be substituted for the actual current datetime). -
Apply the suggested translation improvements listed in
samples/test1/es-MX/assessment-DATETIME/assessment.jsonto the NMT translation insamples/test1/es-MX/assessment-DATETIME/translation.txtand save the improved translation tosamples/test1/es-MX/assessment-DATETIME/applied.txt.