Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork426
Open-source offline translation library written in Python
License
argosopentech/argos-translate
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Demo |Website |Docs |Forum |GitHub |PyPI
Open-source offline translation library written in Python
Argos Translate usesOpenNMT for translations and can be used as either a Python library, command-line, or GUI application. Argos Translate supports installing language model packages which are zip archives with a ".argosmodel" extension containing the data needed for translation.LibreTranslate is an API and web-app built on top of Argos Translate.
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.
Theargospm-index contains metadata and download links to access pre-trained Argos Translate models.
Arabic, Azerbaijani, Basque, Catalan, Chinese, Czech, Danish, Dutch, English, Esperanto, Finnish, French, Galician, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Irish, Italian, Japanese, Kyrgyz, Korean, Malay, Persian, Polish, Portuguese, Portuguese (Brazil), Russian, Slovak, Spanish, Swedish, Turkish, Ukrainian, Urdu, and more
Argos Translate is available fromPyPI and can be easily installed withpip.
pip install argostranslateInstallGUI:
pip install argostranslateguiDownload a copy of this repo and install with pip.
git clone https://github.com/argosopentech/argos-translate.gitcd argos-translatevirtualenv envsource env/bin/activatepip install -e .importargostranslate.packageimportargostranslate.translatefrom_code="en"to_code="es"# Download and install Argos Translate packageargostranslate.package.update_package_index()available_packages=argostranslate.package.get_available_packages()package_to_install=next(filter(lambdax:x.from_code==from_codeandx.to_code==to_code,available_packages ))argostranslate.package.install_from_path(package_to_install.download())# TranslatetranslatedText=argostranslate.translate.translate("Hello World",from_code,to_code)print(translatedText)# '¡Hola Mundo!'
argospm updateargospm install translate-en_deargos-translate --from en --to de "Hello World!"# Hallo Welt!Install all translation packages:
argospm install translateLibreTranslate Web App (Demo)
LibreTranslate API
constres=awaitfetch("https://translate.argosopentech.com/translate",{method:"POST",body:JSON.stringify({q:"Hello!",source:"en",target:"es"}),headers:{"Content-Type":"application/json"}});console.log(awaitres.json());{"translatedText":"¡Hola!"}
The GUI code is in aseparate repository.
To enable GPU support, you need to set theARGOS_DEVICE_TYPE env variable tocuda orauto.
$ ARGOS_DEVICE_TYPE=cuda argos-translate --from-lang en --to-lang es "Hello World"Hola MundoThe above env variable passes the device type toCTranslate2.
Thetranslate-html library is built on top of Argos Translate andBeautiful Soup and parses and translates HTML. The LibreTranslate API also has support for translating HTML.
Theargos-translate-files library is built on top of Argos Translate and parses and translates files. The LibreTranslate API also has support for translating files.
pip uninstall argostranslate
You may choose to also delete temporary and cached files:
rm -r~/.local/cache/argos-translaterm -r~/.local/share/argos-translate
- LibreTranslate-py - Python bindings for LibreTranslate
- MetalTranslate - Customizable translation in C++
- LibreTranslate/Locomotive - Toolkit for training/converting LibreTranslate compatible language models 🚂
- DesktopTranslator -OpenNMT based translation application
- LibreTranslate-rs - LibreTranslate Rust bindings
- LibreTranslate Go - LibreTranslate Golang bindings
- LibreTranslate Java - LibreTranslate Java bindings
- LibreTranslator - LibreTranslate Android app
Contributions are welcome! Available issues are on theGitHub issues page. Contributions of code, data, and pre-trained models can all be accepted.
For support please use theLibreTranslate Forum orGitHub Issues.
For questions aboutCTranslate2 or general machine translation research theOpenNMT Forum is a good resource.
Custom models trained on your own data are available for $1000/language (negotiable).
I am also available for hire to do support, consulting, or custom software development.
If you find this software useful donations are greatly appreciated and help to make this project sustainable.
- GitHub Sponsor
- PayPal
- Venmo @pjfinlay
- Bitcoin: 16UJrmSEGojFPaqjTGpuSMNhNRSsnspFJT
- Ethereum: argosopentech.eth
- Litecoin: MCwu7RRWeCRJdsv2bXGj2nnL1xYxDBvwW5
- BCH: bitcoincash:qzvpxe8y5kq45kahqkyv3p88sjrhlymj2v6xdrj3cv
Paid supporters receive priority support.
You can help support Argos Translate financially by purchasing hosting through these referral links:
- Vast.ai - Cheap GPU rentals
- DigitalOcean - Best all around hosting
- Sharktech - Cheap bandwith
- Time4VPS - Cheap storage
Contributions are welcome! Bug reports, pull requests, documentation writing, and feature ideas are all appreciated.
Argos Translate is dual licensed under either theMIT License orCreative Commons CC0.
About
Open-source offline translation library written in Python
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.


