Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Open-source offline translation library written in Python

License

NotificationsYou must be signed in to change notification settings

argosopentech/argos-translate

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.

Supported languages

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

Request a language

Installation

Install with Python

Argos Translate is available fromPyPI and can be easily installed withpip.

pip install argostranslate

InstallGUI:

pip install argostranslategui

Python source installation into virtualenv

Download 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 .

Examples

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!'

Command Line Interface

argospm updateargospm install translate-en_deargos-translate --from en --to de "Hello World!"# Hallo Welt!

Install all translation packages:

argospm install translate

Web App Screenshot

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!"}

Graphical user interface

The GUI code is in aseparate repository.

ScreenshotScreenshot2

GPU Acceleration

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 Mundo

The above env variable passes the device type toCTranslate2.

HTML Translation

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.

Files Translation

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.

Uninstall

pip uninstall argostranslate

You may choose to also delete temporary and cached files:

rm -r~/.local/cache/argos-translaterm -r~/.local/share/argos-translate

Related Projects

Contributing

Contributions are welcome! Available issues are on theGitHub issues page. Contributions of code, data, and pre-trained models can all be accepted.

Support

For support please use theLibreTranslate Forum orGitHub Issues.

For questions aboutCTranslate2 or general machine translation research theOpenNMT Forum is a good resource.

Services

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.

Donate

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.

Hosting affiliate links

You can help support Argos Translate financially by purchasing hosting through these referral links:

Contributing

Contributions are welcome! Bug reports, pull requests, documentation writing, and feature ideas are all appreciated.

License

Argos Translate is dual licensed under either theMIT License orCreative Commons CC0.

About

Open-source offline translation library written in Python

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

[8]ページ先頭

©2009-2026 Movatter.jp