Package: argostranslate
Argos TranslateDemo|Website|Docs|Forum|GitHub|PyPIOpen-source offline translation library written in PythonArgos Translate usesOpenNMTfor 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.LibreTranslateis 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.Supported languagesArabic, Azerbaijani, Catalan, Chinese, Czech, Danish, Dutch, English, Esperanto, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Irish, Italian, Japanese, Korean, Persian, Polish, Portuguese, Russian, Slovak, Spanish, Swedish, Turkish, UkrainianRequest a languageInstallationInstall with PythonArgos Translate is available fromPyPIand can be easily installed or updated withpip.pip install argostranslateInstallGUI:pip install argostranslateguiInstallation for macOSDownload the latestmacOS release.Extract the archive.Copy the.appfile to the Applications directory.Python source installation into virtualenvDownload a copy of this repo and install with pip.git clone https://github.com/argosopentech/argos-translate.git
cd argos-translate
virtualenv env
source env/bin/activate
pip install -e .ExamplesPythonimportargostranslate.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!'Command Line Interfaceargospm update
argospm install translate-en_de
argos-translate --from en --to de "Hello World!"
# Hallo Welt!Install all translation packages:argospm install translateLibreTranslateWeb App (Demo)LibreTranslateAPIconstres=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!"}Graphical user interfaceThe GUI code is in aseparate repository.PackagesBrowseP2P download (IPFS and BitTorrent)Training scriptsGoogle Drive downloadGPU AccelerationTo enable GPU support, you need to set theARGOS_DEVICE_TYPEenv variable tocudaorauto.$ ARGOS_DEVICE_TYPE=cuda argos-translate --from-lang en --to-lang es "Hello World"
Hola MundoThe above env variable passes the device type toCTranslate2.HTML TranslationThetranslate-htmllibrary is built on top of Argos Translate andBeautiful Soupand parses and translates HTML. The LibreTranslate API also has support for translating HTML.Files TranslationTheargos-translate-fileslibrary is built on top of Argos Translate and parses and translates files. The LibreTranslate API also has support for translating files.UninstallpipuninstallargostranslateYou may choose to also delete temporary and cached files:rm-r~/.local/cache/argos-translate
rm-r~/.local/share/argos-translateRelated ProjectsLibreTranslate-py- Python bindings for LibreTranslateMetalTranslate- Customizable translation in C++DesktopTranslator-OpenNMTbased translation applicationLibreTranslate-rs- LibreTranslate Rust bindingsLibreTranslate Go- LibreTranslate Golang bindingsLibreTranslator- LibreTranslate Android appLiTranslate- iOS LibreTranslate clientContributingContributions are welcome! Available issues are on theGitHub issues page. Contributions of code, data, and pre-trained models can all be accepted.SupportFor support please use theLibreTranslate ForumorGitHub Issues.For questions aboutCTranslate2or general machine translation research theOpenNMT Forumis a good resource.ServicesCustom models trained on your own data are available for $1000/language (negotiable).I am also available for hireto do support, consulting, or custom software development.DonateIf you find this software useful donations are appreciated.GitHub SponsorPayPalBitcoin: 16UJrmSEGojFPaqjTGpuSMNhNRSsnspFJTEthereum: argosopentech.ethPaid supporters receive priority support.Hosting affiliate linksYou can help support Argos Translate financially by purchasing hosting through these referral links:Vast.ai- Cheap GPU rentalsDigitalOcean- Best all around hostingSharktech- Cheap bandwithTime4VPS- Cheap storageArgos Translate 2 betaA beta version of Argos Translate 2 is available to install from source from thev2 branch on GitHub. Argos Translate 2 has amultilingual model architecture, more extensive unit testing, and a more experimental orientation.ContributingContributions are welcome! Bug reports, pull requests, documentation writing, and feature ideas are all appreciated.LicenseArgos Translate is dual licensed under either theMIT LicenseorCreative Commons CC0.