Argos Translate Documentation¶
Open-source offline translation library written in Python. Uses OpenNMT for translations, SentencePiece for tokenization, Stanza for sentence boundary detection, and PyQt for GUI. Designed to be used as either a Python library, command-line, or GUI application. LibreTranslate is an API and web-app built on top of Argos Translate.
Argos Translate supports installing model files which are a zip archive with an “.argosmodel” extension that contains an OpenNMT CTranslate2 model, a SentencePiece tokenization model, a Stanza tokenizer model for sentence boundary detection, and metadata about the model.
Argos Translate also manages automatically pivoting through intermediate languages to translate between languages that don’t have a direct translation between them installed. For example, if you have a es ➔ en and en ➔ fr translation installed you are able to translate from es ➔ fr as if you had that translation installed. This allows for translating between a wide variety of languages at the cost of some loss of translation quality.
Command Line Interface¶
argos-translate --from-lang en --to-lang es "Hello World"
Hola Mundo
echo "Text to translate" | argos-translate --from-lang en --to-lang es
Texto para traducir
argospm --help
usage: argospm [-h] {update,search,install,list,remove} ...
positional arguments:
{update,search,install,list,remove}
Available commands.
update Downloads remote package index.
search Search package from remote index.
install Install package.
list List installed packages.
remove Remove installed package.
optional arguments:
-h, --help show this help message and exit
Update¶
Downloads remote package index.
argospm update
Search¶
Search package from remote index.
argospm search --from-lang en --to-lang es
Install¶
Install package.
argospm install translate-en_es
List¶
List installed packages.
argospm list
Remove¶
Remove installed package.
argospm remove translate-en_es
Enable tab completion for Bash¶
curl -sSL https://raw.githubusercontent.com/argosopentech/argos-translate/master/tab_completions/completion.bash > /etc/bash_completion.d/argospm.bash