Open-source offline translation library written in Python. Uses OpenNMT for translations

Overview

Argos Translate

Docs | Website | Video intro | GitHub | Dependencies

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. Pretrained models can be downloaded here.

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.

Models

Supported languages

Arabic, Azerbaijani, Chinese, Czech, Dutch, English, Finnish, French, German, Greek, Hindi, Hungarian, Indonesian, Irish, Italian, Japanese, Korean, Polish, Portuguese, Russian, Spanish, Swedish, Turkish, Ukranian, Vietnamese

Screenshots

GUI

Screenshot Screenshot2 Argos Translate macOS Screenshot

Installation

Install from PyPI

Argos Translate is available from PyPI and can be easily installed or updated with pip.

pip3 install argostranslate

Install GUI:

pip3 install argostranslategui

Install from Snap Store

Argos Translate is available from the Snap Store and auto installs a content snap to support translation between Arabic, Chinese, English, French, Russian, and Spanish. Additional languages can be installed from supplementary content snaps.

With snapd installed:

sudo snap install argos-translate

Get it from the Snap Store

Automatically installs and connects to argos-translate-base-langs snap to support translations between Arabic, Chinese, English, French, Russian, and Spanish.

Additional languages can be installed from *.argosmodel files or from supplementary content snaps:

  • argos-translate-de-en - German - English
  • argos-translate-en-it - English - Italian
  • argos-translate-en-pt - English - Portuguese

To connect automatically: sudo snap connect argos-translate:argos-packages argos-translate-en-it:argos-packages

To run command line interface on Snapcraft:

argos-translate.cli --help

Installation for macOS

  1. Download the latest macOS release.
  2. Extract the archive.
  3. Copy the .app file to the Applications directory.

Python source installation

Dependencies

Requires Python3, pip (which should come with Python3), and optionally virtualenv to keep Argos Translate's dependencies separate from other Python programs you have installed.

Python Installation Instructions

On Ubuntu:

sudo apt-get update
sudo apt-get install -y python3

Install

  1. Download a copy of this repo (this requires either installing git or downloading a zip from GitHub):
git clone https://github.com/argosopentech/argos-translate.git
cd argos-translate
  1. Make a virtual environment to install into (optional):
pip3 install --upgrade virtualenv # If virtualenv not already installed
virtualenv env
source env/bin/activate
  1. Install this package with pip:
pip3 install --upgrade pip
pip3 install -e .

Graphical user interface

Note that the GUI code is in a separate repo. To install the GUI perform the same steps with the code in GUI repo after installing Argos Translate.

GPU Acceleration

To enable GPU support, you need to set the ARGOS_DEVICE_TYPE env variable to cuda or auto.

$ ARGOS_DEVICE_TYPE=cuda argos-translate --from-lang en --to-lang es "Hello World"
Hola Mundo

The above env variable instructs CTranslate2 to use cuda. if you encounter any issues with GPU, please consider reading CTranslate2 documentation.

Build and install snap package

Run Argos Translate!

GUI

Run the GUI version of Argos Translate.

argos-translate-gui

When installing with snap a .desktop file should also be installed which will make Argos Translate available from the desktop menu.

Languages are chosen as drop down choices. More languages pairs can be installed.

The left text box translates into the right box.

Example workflow translating from Vietnamese into English:

  1. Set the left drop down to Vietnamese and the right drop down to English.
  2. Replace the default text Text to translate from in the left text box with some text in Vietnamese. A quick way to do this is to click in the left text box and press the keyboard shortcut CTRL+a to select all and then CTRL+v to paste.
  3. Wait patiently.
  4. When text appears in the right text box, read the translation!

If the output looks similar to the input, try changing the origin language as some languages appear similar if you are unfamiliar with them.

Command Line

Run the command line version of Argos Translate.

argos-translate

Translate a string from English to Spanish.

Note: If you do not have the language pair that you are calling installed, you will get a Traceback error.

argos-translate --from-lang en --to-lang es "Hello World."
Hola Mundo

Translate longer text piped into argos-translate.

echo "Text to translate" | argos-translate --from-lang en --to-lang es
Texto para traducir

Adding language pair models

Language pairs are on average 100MB each.

Installing new pairs through the GUI

  1. Open Argos Translate: argos-translate-gui
  2. Click on the Manage Packages menu item.
  3. Click on the Download packages button.
  4. Click on the down arrow beside a language pair that you want to add.
  5. Wait for the hourglass icon to change into a check mark icon.
  6. Repeat the last two steps until you have all of the language pairs that you want.
  7. Click on the X in the top right to close the Download packages window.
  8. Click on the X in the top right to close the Manage Packages window.

Note: The Download packages screen does not seem to have a scroll bar so you will probably need to follow the next set of instructions to import new pairs through the GUI.

Importing new pairs through the GUI

  1. Download or make new pairs. Model links can be downloaded from this page or this JSON file.
  2. Open Argos Translate: argos-translate-gui
  3. Click on the Manage Packages menu item.
  4. Click on the Install package file button.
  5. Navigate to where you downloaded the new language pairs, click on the .argosmodel file, and click on the Open button.
  6. Repeat the last two steps until you have all of the language pairs that you want.
  7. Click on the X in the top right to close the Manage Packages window.

Importing new pairs through the CLI

  1. Update list of available language pairs: argospm update
  2. List all available language pairs: argospm search
  3. Install new pair syntax: argospm install *lang_pair_name*

For example, install Turkish to English pair: argospm install translate-tr_en

Optionally, you could install all language pairs using BASH.

for i in $(argospm search | sed 's/:.*$//g'); do argospm install $i ; done

Removing a pair through the GUI

  1. Open Argos Translate: argos-translate-gui
  2. Click on the Manage Packages menu item.
  3. Click on the trash can icon besides the pair you want to remove.
  4. Click on the X in the top right to close the Manage Packages window.

Removing a pair through the CLI

  1. Remove the Turkish to English pair: argospm remove translate-tr_en

Optionally, you could remove all language pairs using BASH if you need to free space fast.

for i in $(argospm list); do argospm remove $i ; done

Examples

Python

>> '¡Hola Mundo!'">
from argostranslate import package, translate
package.install_from_path('en_es.argosmodel')
installed_languages = translate.get_installed_languages()

>>> [str(lang) for lang in installed_languages]
>>> ['English', 'Spanish']

translation_en_es = installed_languages[0].get_translation(installed_languages[1])
translation_en_es.translate("Hello World!")

>>> '¡Hola Mundo!'

LibreTranslate Web App (Demo)

Web App Screenshot

LibreTranslate API

const res = await fetch("https://libretranslate.com/translate", {
	method: "POST",
	body: JSON.stringify({
		q: "Hello!",
		source: "en",
		target: "es"
	}),
	headers: {
		"Content-Type": "application/json"}
	});

console.log(await res.json());

{
    "translatedText": "¡Hola!"
}

HTML Translation

The translate-html library is built on top of Argos Translate and Beautiful Soup and parses and translates HTML. The LibreTranslate API also has support for translating HTML.

Files Translation

The argos-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

If you want to uninstall Argos Translate, you may choose the applicable method.

Uninstall PYPI/pip package

If you installed Argos Translate via pip you can uninstall it using

python3 -m pip uninstall argostranslate

You may choose to also delete temporary and cached files:

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

Uninstall Snap

The following command will uninstall the snap package.

sudo snap remove argos-translate argos-translate-base-langs

If you installed additional language packs, you might want to remove them as well, e.g.

sudo snap remove argos-translate-de-en

Contributing

Awesome Humane Tech

Contributions are welcome! Available issues are on the GitHub issues page.

Support

For support use GitHub Issues, Github Discussions, or the LibreTranslate Forum.

Custom models

Custom models trained on your own data are available for $1000/each (negotiable).

Donations

If you find this software useful donations are appreciated.

  • GitHub Sponsor
  • PayPal
  • Ethereum: 0x4E9017d8e275cA54C91E056381DAb9fe6ECC1AF6
  • Bitcoin cash: qzqklgjpgutdqqlhcasmdd2hkqcelw426sxzk5qtne
  • Bitcoin: 16UJrmSEGojFPaqjTGpuSMNhNRSsnspFJT
  • Filecoin: f1nrnpmjxn27amidyiqrzq5mxihdo2trh2oijw2sq
  • Basic Attention Token: 0x8a16f26D277f924B04FCA5ECec64b76B5410A06c
  • Cheap Eth: 0x996133E61b81c300a37ACa9b24898685eB872b61

Paid supporters receive priority support.

License

Dual licensed under either the MIT License or CC0.

Comments
  • Massively repeated characters on MacOS

    Massively repeated characters on MacOS

    argos-translate --from-lang en --to-lang ru "Hello World"
    >>>  З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З! З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З! З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З З
    

    or another example

    argos-translate --from-lang en --to-lang ru "Good to see you"
    >>>  У! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До! До!
    

    tried script agro-translate.py:

    import argostranslate
    from argostranslate import package, translate
    package.install_from_path('translate_en_ru.argosmodel')
    
    installed_languages = translate.get_installed_languages()
    for lang in installed_languages:
      print(lang)
     
    translation_en_ru = installed_languages[0].get_translation(installed_languages[1])
    translated = translation_en_ru.translate("How are you!")
    print(translated)
    

    and got:

    python agro-translate.py 
    >>> English
    >>> Russian
    >>> ?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    

    what did i do wrong? Mac OS 11.1 Big Sur

    opened by exvayn 21
  • Compilation error in FreeBSD

    Compilation error in FreeBSD

    I'd like to compile argos-translate in a FreeBSD system. It's supposed to be installed locally. Perhaps there are some packages missing that could be installed globally. Is there a list of packages to be installed, besides Python 3.8 and Qt5?

    python3 -m pip install argostranslate
    Defaulting to user installation because normal site-packages is not writeable
    Collecting argostranslate
      Using cached argostranslate-1.5.2-py3-none-any.whl (30 kB)
    Collecting PyQt5==5.15.4
      Using cached PyQt5-5.15.4.tar.gz (3.3 MB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
        Preparing wheel metadata ... error
        ERROR: Command errored out with exit status 1:
         command: /usr/local/bin/python3 /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp4cdt4aal
             cwd: /tmp/pip-install-953r8nsq/pyqt5_46a027e9f4f24884bf1b30ba03152645
        Complete output (31 lines):
        Traceback (most recent call last):
          File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 126, in prepare_metadata_for_build_wheel
            hook = backend.prepare_metadata_for_build_wheel
        AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
    
        During handling of the above exception, another exception occurred:
    
        Traceback (most recent call last):
          File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
            main()
          File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
          File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 130, in prepare_metadata_for_build_wheel
            return _get_wheel_metadata_from_wheel(backend, metadata_directory,
          File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 159, in _get_wheel_metadata_from_wheel
            whl_basename = backend.build_wheel(metadata_directory, config_settings)
          File "/tmp/pip-build-env-jmsxirts/overlay/lib/python3.8/site-packages/sipbuild/api.py", line 51, in build_wheel
            project = AbstractProject.bootstrap('pep517')
          File "/tmp/pip-build-env-jmsxirts/overlay/lib/python3.8/site-packages/sipbuild/abstract_project.py", line 83, in bootstrap
            project.setup(pyproject, tool, tool_description)
          File "/tmp/pip-build-env-jmsxirts/overlay/lib/python3.8/site-packages/sipbuild/project.py", line 484, in setup
            self.apply_user_defaults(tool)
          File "project.py", line 63, in apply_user_defaults
            super().apply_user_defaults(tool)
          File "/tmp/pip-build-env-jmsxirts/overlay/lib/python3.8/site-packages/pyqtbuild/project.py", line 70, in apply_user_defaults
            super().apply_user_defaults(tool)
          File "/tmp/pip-build-env-jmsxirts/overlay/lib/python3.8/site-packages/sipbuild/project.py", line 230, in apply_user_defaults
            self.builder.apply_user_defaults(tool)
          File "/tmp/pip-build-env-jmsxirts/overlay/lib/python3.8/site-packages/pyqtbuild/builder.py", line 66, in apply_user_defaults
            raise PyProjectOptionException('qmake',
        sipbuild.pyproject.PyProjectOptionException
        ----------------------------------------
    WARNING: Discarding https://files.pythonhosted.org/packages/8e/a4/d5e4bf99dd50134c88b95e926d7b81aad2473b47fde5e3e4eac2c69a8942/PyQt5-5.15.4.tar.gz#sha256=2a69597e0dd11caabe75fae133feca66387819fc9bc050f547e5551bce97e5be (from https://pypi.org/simple/pyqt5/) (requires-python:>=3.6). Command errored out with exit status 1: /usr/local/bin/python3 /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp4cdt4aal Check the logs for full command output.
    
    
    opened by lpvm 21
  • Command-line Usage

    Command-line Usage

    Would it be possible to support command-line usage? I searched the documentation but found nothing. I would like to automate translating texts and also text files into multiple languages.

    As an example I suggest the following: argos-translate -text "Hello World!" -from en -to de argos-translate -file Novel.txt -from en -to de

    enhancement help wanted 
    opened by fleschutz 12
  • OMP: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already intialized

    OMP: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already intialized

    Hi, Thanks for the amazing project. This was a fresh install on a new python 3.8.3 virtual environment using pip install and launching straight away. The web app launches, but after a few key strokes, the process crashes with the following error logged to the terminal: OMP: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/. Abort trap: 6

    Any advice appreciated here, thanks again.

    opened by nikohunt 10
  • Better model distribution

    Better model distribution

    Currently models are distributed by Google Drive (not ideal) and a slow BitTorrent, so there's lots of room for improvement:

    • More Torrent seeders
    • Create individual torrent files for each model
    • HTTP or FTP mirrors
    • I avoided git distribution because I was worried about running into GitHub limits but we may want to link to the LibreTranslate Git Mirror
    • Open to other ideas too

    The plan was to make a separate repo for storing model distribution information so let me know if your interested.

    enhancement help wanted good first issue 
    opened by PJ-Finlay 10
  • Translation error

    Translation error

    opened by dingedi 8
  • Segmentation fault, memory error? [There appear to be 1 leaked semaphore objects]

    Segmentation fault, memory error? [There appear to be 1 leaked semaphore objects]

    Hey there! First of all, thanks for your fantastic work here. Really love this project 😄

    I'm trying to run the python library of argos, something like doing this in my code:

    installed_languages = translate.get_installed_languages()
    print([str(lang) for lang in installed_languages])
    
    print("Installed argos languages:")
    fr = [lang for lang in installed_languages if lang.name == "French"][-1]
    en = [lang for lang in installed_languages if lang.name == "English"][-1]
    es = [lang for lang in installed_languages if lang.name == "Spanish"][-1]
    breakpoint()
    translation_fr_en = fr.get_translation(en)
    print(translation_fr_en.translate("Bonjour monde!"))
    

    But I'm facing some issues.

    To be more specific, I'm actually running with the Kedro framework inside of a pipeline module.

    When running the above code, I got the following error:

    23642 segmentation fault  kedro run --pipeline translate
    

    Upon closer inspection, when setting up breakpoints, the following happens:

    (Pdb) print(translation_fr_en.translate("Bonjour monde!"))
    [1]    23698 segmentation fault  kedro run --pipeline translate_news
    /Users/--/python/3.8.9/lib/python3.8/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown              
      warnings.warn('resource_tracker: There appear to be %d '
    

    Do you have any idea of what this could be? I've bashed my head quite a lot, but figuring there's something wrong?

    In a notebook, I can run the following code no problem...

    opened by duarteocarmo 7
  • Potential regression after updating to the latest version

    Potential regression after updating to the latest version

    I've noticed different output from LibreTranslate and the latest version of argos-translate for Chinese language. LibreTranslate uses argostranslate==1.1.4.

    I've tested this problem locally and got the same results. It looks like a regression to me. Both versions are using the same model.

    Original sentence (in English, translated using GoogleTranslate):

    Hi there, this is a Chinese sentence. How are you doing today?
    

    argostranslate==1.3.0

     echo "嗨,这是中文句子。 你今天过得怎么样?" | argos-translate --from-lang zh --to-lang en
    Pierre, the Chinese sentence. What you have done today?
    

    LibreTranslate (argostranslate==1.1.4):

    This is the Chinese sentence. What is you doing today?
    
    opened by rushter 7
  • Helpful error message when user forgets to run `argospm update`

    Helpful error message when user forgets to run `argospm update`

    $ argospm install translate-en_es
    Traceback (most recent call last):
      File "/home/argosopentech/onmt-models/env/lib/python3.8/site-packages/argostranslate/package.py", line 216, in get_available_packages
        with open(settings.local_package_index) as index_file:
    FileNotFoundError: [Errno 2] No such file or directory: '/home/argosopentech/.local/cache/argos-translate/index.json'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/home/argosopentech/onmt-models/env/bin/argospm", line 5, in <module>
        argospm.main()
      File "/home/argosopentech/onmt-models/env/lib/python3.8/site-packages/argostranslate/argospm.py", line 108, in main
        args.callback(args)
      File "/home/argosopentech/onmt-models/env/lib/python3.8/site-packages/argostranslate/argospm.py", line 29, in install_package
        available_packages = package.get_available_packages()
      File "/home/argosopentech/onmt-models/env/lib/python3.8/site-packages/argostranslate/package.py", line 224, in get_available_packages
        raise Exception('Local package index not found,' +
    Exception: Local package index not found, use package.update_package_index() to load it
    
    opened by PJ-Finlay 7
  • Start tests

    Start tests

    This starts the fix to #11 Write tests for most classes and methods in translate.py This is just a start to writing the tests for this project, and this PR is just to kick-start that process.

    This PR contains tests for the following classes including all of their methods

    • Hypothesis
    • ITranslation
    • Language
    • IdentityTranslation
    • CompositeTranslation
    opened by JakeRoggenbuck 6
  • Filter HTML entities in training scripts data

    Filter HTML entities in training scripts data

    Hello, I've noticed a bug when translating something to French. Sometime, there is the HTML entity &apos; appearing instead of the apostrophe. Some examples: argos-translate1 argos-translate2 argos-translate5

    Though it doesn't happen in these cases argos-translate4 argos-translate3

    opened by quentin-bettoum 6
  • Reporting bad translation from English to Portuguese and Spanish

    Reporting bad translation from English to Portuguese and Spanish

    I did test a bit the website of libretranslate and the first issue I found was in the Portuguese to English translation or vice-versa using the term "I think", which translation is "I think so" -> Kind of funny... maybe the machine is answer the question or the translator did answer to the text he/she should translate :D

    So the correct translation from English to Portuguese of "I think" should be "Eu Penso". The same for Spanish: "I think" should be "Yo Pienso"

    opened by imagineyourselfs 0
  • Failed to install Argos-translate in Lubuntu 22.04.

    Failed to install Argos-translate in Lubuntu 22.04.

    Hello! For my first post I just want to say thanks for your work. I hope I can use this software for offline translation, helping people with limited connexion or avoiding a bit more Google and other bad guys would be cool. Sorry for my english I'm french-speaker, and I don't have much skills in computing.

    1 or 2 months ago I had already tried to install Argos (following installation page here on Github) but for some reason, several times after downloading hundreds of MB it aborted, I don't remember the details but well I gave up. Yesterday I tried again and it seemed to work better.

    First I put pip install argostranslate:

    me@me-pc:~$ pip install argostranslate
    Defaulting to user installation because normal site-packages is not writeable
    Collecting argostranslate
      Downloading argostranslate-1.7.5-py3-none-any.whl (27 kB)
    Collecting sentencepiece==0.1.96
      Downloading sentencepiece-0.1.96-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 1.4 MB/s eta 0:00:00
    Collecting ctranslate2==2.24.0
      Downloading ctranslate2-2.24.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.3 MB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.3/18.3 MB 1.2 MB/s eta 0:00:00
    Collecting stanza==1.1.1
      Downloading stanza-1.1.1-py3-none-any.whl (227 kB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 227.6/227.6 KB 632.8 kB/s eta 0:00:00
    Requirement already satisfied: pyyaml<7,>=5.3 in /usr/lib/python3/dist-packages (from ctranslate2==2.24.0->argostranslate) (5.4.1)
    Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from ctranslate2==2.24.0->argostranslate) (1.21.5)
    Collecting torch>=1.3.0
      Downloading torch-1.13.1-cp310-cp310-manylinux1_x86_64.whl (887.5 MB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 887.5/887.5 MB ? eta 0:00:00
    Requirement already satisfied: protobuf in /usr/lib/python3/dist-packages (from stanza==1.1.1->argostranslate) (3.12.4)
    Collecting tqdm
      Downloading tqdm-4.64.1-py2.py3-none-any.whl (78 kB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.5/78.5 KB 614.4 kB/s eta 0:00:00
    Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from stanza==1.1.1->argostranslate) (2.25.1)
    Collecting nvidia-cudnn-cu11==8.5.0.96
      Downloading nvidia_cudnn_cu11-8.5.0.96-2-py3-none-manylinux1_x86_64.whl (557.1 MB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 557.1/557.1 MB ? eta 0:00:00
    Collecting typing-extensions
      Downloading typing_extensions-4.4.0-py3-none-any.whl (26 kB)
    Collecting nvidia-cuda-runtime-cu11==11.7.99
      Downloading nvidia_cuda_runtime_cu11-11.7.99-py3-none-manylinux1_x86_64.whl (849 kB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 849.3/849.3 KB 44.6 kB/s eta 0:00:00
    Collecting nvidia-cuda-nvrtc-cu11==11.7.99
      Downloading nvidia_cuda_nvrtc_cu11-11.7.99-2-py3-none-manylinux1_x86_64.whl (21.0 MB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 21.0/21.0 MB 987.4 kB/s eta 0:00:00
    Collecting nvidia-cublas-cu11==11.10.3.66
      Downloading nvidia_cublas_cu11-11.10.3.66-py3-none-manylinux1_x86_64.whl (317.1 MB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 317.1/317.1 MB 515.3 kB/s eta 0:00:00
    Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from nvidia-cublas-cu11==11.10.3.66->torch>=1.3.0->stanza==1.1.1->argostranslate) (59.6.0)
    Requirement already satisfied: wheel in /usr/lib/python3/dist-packages (from nvidia-cublas-cu11==11.10.3.66->torch>=1.3.0->stanza==1.1.1->argostranslate) (0.37.1)
    Installing collected packages: sentencepiece, typing-extensions, tqdm, nvidia-cuda-runtime-cu11, nvidia-cuda-nvrtc-cu11, nvidia-cublas-cu11, ctranslate2, nvidia-cudnn-cu11, torch, stanza, argostranslate
      WARNING: The script tqdm is installed in '/home/me/.local/bin' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
      WARNING: The scripts ct2-fairseq-converter, ct2-marian-converter, ct2-openai-gpt2-converter, ct2-opennmt-py-converter, ct2-opennmt-tf-converter, ct2-opus-mt-converter and ct2-transformers-converter are installed in '/home/me/.local/bin' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    ERROR: Could not install packages due to an OSError: [Errno 28] No space left on device
    

    Following what said last line, I moved some files to make room and I put again pip install argostranslate:

    me@me-pc:~$ pip install argostranslate
    Defaulting to user installation because normal site-packages is not writeable
    Collecting argostranslate
      Using cached argostranslate-1.7.5-py3-none-any.whl (27 kB)
    Requirement already satisfied: ctranslate2==2.24.0 in ./.local/lib/python3.10/site-packages (from argostranslate) (2.24.0)
    Collecting stanza==1.1.1
      Using cached stanza-1.1.1-py3-none-any.whl (227 kB)
    Requirement already satisfied: sentencepiece==0.1.96 in ./.local/lib/python3.10/site-packages (from argostranslate) (0.1.96)
    Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from ctranslate2==2.24.0->argostranslate) (1.21.5)
    Requirement already satisfied: pyyaml<7,>=5.3 in /usr/lib/python3/dist-packages (from ctranslate2==2.24.0->argostranslate) (5.4.1)
    Requirement already satisfied: protobuf in /usr/lib/python3/dist-packages (from stanza==1.1.1->argostranslate) (3.12.4)
    Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from stanza==1.1.1->argostranslate) (2.25.1)
    Requirement already satisfied: torch>=1.3.0 in ./.local/lib/python3.10/site-packages (from stanza==1.1.1->argostranslate) (1.13.1)
    Requirement already satisfied: tqdm in ./.local/lib/python3.10/site-packages (from stanza==1.1.1->argostranslate) (4.64.1)
    Requirement already satisfied: nvidia-cudnn-cu11==8.5.0.96 in ./.local/lib/python3.10/site-packages (from torch>=1.3.0->stanza==1.1.1->argostranslate) (8.5.0.96)
    Requirement already satisfied: nvidia-cuda-nvrtc-cu11==11.7.99 in ./.local/lib/python3.10/site-packages (from torch>=1.3.0->stanza==1.1.1->argostranslate) (11.7.99)
    Requirement already satisfied: nvidia-cublas-cu11==11.10.3.66 in ./.local/lib/python3.10/site-packages (from torch>=1.3.0->stanza==1.1.1->argostranslate) (11.10.3.66)
    Requirement already satisfied: typing-extensions in ./.local/lib/python3.10/site-packages (from torch>=1.3.0->stanza==1.1.1->argostranslate) (4.4.0)
    Requirement already satisfied: nvidia-cuda-runtime-cu11==11.7.99 in ./.local/lib/python3.10/site-packages (from torch>=1.3.0->stanza==1.1.1->argostranslate) (11.7.99)
    Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from nvidia-cublas-cu11==11.10.3.66->torch>=1.3.0->stanza==1.1.1->argostranslate) (59.6.0)
    Requirement already satisfied: wheel in /usr/lib/python3/dist-packages (from nvidia-cublas-cu11==11.10.3.66->torch>=1.3.0->stanza==1.1.1->argostranslate) (0.37.1)
    Installing collected packages: stanza, argostranslate
    Successfully installed argostranslate-1.7.5 stanza-1.1.1
    me@me-pc:~$
    

    And then the GUI:

    me@me-pc:~$ pip install argostranslategui
    Defaulting to user installation because normal site-packages is not writeable
    Collecting argostranslategui
      Downloading argostranslategui-1.6.3-py3-none-any.whl (6.7 kB)
    Requirement already satisfied: argostranslate in ./.local/lib/python3.10/site-packages (from argostranslategui) (1.7.5)
    Collecting PyQt5==5.15.4
      Downloading PyQt5-5.15.4-cp36.cp37.cp38.cp39-abi3-manylinux2014_x86_64.whl (8.3 MB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.3/8.3 MB 1.1 MB/s eta 0:00:00
    Requirement already satisfied: PyQt5-sip<13,>=12.8 in /usr/lib/python3/dist-packages (from PyQt5==5.15.4->argostranslategui) (12.9.1)
    Collecting PyQt5-Qt5>=5.15
      Downloading PyQt5_Qt5-5.15.2-py3-none-manylinux2014_x86_64.whl (59.9 MB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 59.9/59.9 MB 1.0 MB/s eta 0:00:00
    Requirement already satisfied: ctranslate2==2.24.0 in ./.local/lib/python3.10/site-packages (from argostranslate->argostranslategui) (2.24.0)
    Requirement already satisfied: stanza==1.1.1 in ./.local/lib/python3.10/site-packages (from argostranslate->argostranslategui) (1.1.1)
    Requirement already satisfied: sentencepiece==0.1.96 in ./.local/lib/python3.10/site-packages (from argostranslate->argostranslategui) (0.1.96)
    Requirement already satisfied: pyyaml<7,>=5.3 in /usr/lib/python3/dist-packages (from ctranslate2==2.24.0->argostranslate->argostranslategui) (5.4.1)
    Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from ctranslate2==2.24.0->argostranslate->argostranslategui) (1.21.5)
    Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from stanza==1.1.1->argostranslate->argostranslategui) (2.25.1)
    Requirement already satisfied: protobuf in /usr/lib/python3/dist-packages (from stanza==1.1.1->argostranslate->argostranslategui) (3.12.4)
    Requirement already satisfied: tqdm in ./.local/lib/python3.10/site-packages (from stanza==1.1.1->argostranslate->argostranslategui) (4.64.1)
    Requirement already satisfied: torch>=1.3.0 in ./.local/lib/python3.10/site-packages (from stanza==1.1.1->argostranslate->argostranslategui) (1.13.1)
    Requirement already satisfied: nvidia-cublas-cu11==11.10.3.66 in ./.local/lib/python3.10/site-packages (from torch>=1.3.0->stanza==1.1.1->argostranslate->argostranslategui) (11.10.3.66)
    Requirement already satisfied: nvidia-cuda-runtime-cu11==11.7.99 in ./.local/lib/python3.10/site-packages (from torch>=1.3.0->stanza==1.1.1->argostranslate->argostranslategui) (11.7.99)
    Requirement already satisfied: typing-extensions in ./.local/lib/python3.10/site-packages (from torch>=1.3.0->stanza==1.1.1->argostranslate->argostranslategui) (4.4.0)
    Requirement already satisfied: nvidia-cuda-nvrtc-cu11==11.7.99 in ./.local/lib/python3.10/site-packages (from torch>=1.3.0->stanza==1.1.1->argostranslate->argostranslategui) (11.7.99)
    Requirement already satisfied: nvidia-cudnn-cu11==8.5.0.96 in ./.local/lib/python3.10/site-packages (from torch>=1.3.0->stanza==1.1.1->argostranslate->argostranslategui) (8.5.0.96)
    Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from nvidia-cublas-cu11==11.10.3.66->torch>=1.3.0->stanza==1.1.1->argostranslate->argostranslategui) (59.6.0)
    Requirement already satisfied: wheel in /usr/lib/python3/dist-packages (from nvidia-cublas-cu11==11.10.3.66->torch>=1.3.0->stanza==1.1.1->argostranslate->argostranslategui) (0.37.1)
    Installing collected packages: PyQt5-Qt5, PyQt5, argostranslategui
      WARNING: The scripts pylupdate5, pyrcc5 and pyuic5 are installed in '/home/me/.local/bin' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    Successfully installed PyQt5-5.15.4 PyQt5-Qt5-5.15.2 argostranslategui-1.6.3
    me@me-pc:~$
    

    Last lines of the 2 outputs say "successfully installed". But well I couldn't find Argos in main Menu, and running argos-translate in terminal said something like "command unknown" if I remember.

    There is a maybe problematic line in the beginning Defaulting to user installation because normal site-packages is not writeable But I don't know what to do with it so I left it.

    But there are also several lines

    WARNING: The scripts (blahblah...) are installed in '/home/me/.local/bin' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    

    Had never heard of this "PATH" thing, but I found here for example that I seemed to have to add a line in /home/me/.bashrc file, which I did: export PATH="$PATH:/home/me/.local/bin"

    After that, I made a small chek by re-running install command:

    me@me-pc:~$ pip install argostranslate
    Defaulting to user installation because normal site-packages is not writeable
    Requirement already satisfied: argostranslate in ./.local/lib/python3.10/site-packages (1.7.5)
    Requirement already satisfied: ctranslate2==2.24.0 in ./.local/lib/python3.10/site-packages (from argostranslate) (2.24.0)
    Requirement already satisfied: stanza==1.1.1 in ./.local/lib/python3.10/site-packages (from argostranslate) (1.1.1)
    Requirement already satisfied: sentencepiece==0.1.96 in ./.local/lib/python3.10/site-packages (from argostranslate) (0.1.96)
    Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from ctranslate2==2.24.0->argostranslate) (1.21.5)
    Requirement already satisfied: pyyaml<7,>=5.3 in /usr/lib/python3/dist-packages (from ctranslate2==2.24.0->argostranslate) (5.4.1)
    Requirement already satisfied: tqdm in ./.local/lib/python3.10/site-packages (from stanza==1.1.1->argostranslate) (4.64.1)
    Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from stanza==1.1.1->argostranslate) (2.25.1)
    Requirement already satisfied: torch>=1.3.0 in ./.local/lib/python3.10/site-packages (from stanza==1.1.1->argostranslate) (1.13.1)
    Requirement already satisfied: protobuf in /usr/lib/python3/dist-packages (from stanza==1.1.1->argostranslate) (3.12.4)
    Requirement already satisfied: nvidia-cuda-nvrtc-cu11==11.7.99 in ./.local/lib/python3.10/site-packages (from torch>=1.3.0->stanza==1.1.1->argostranslate) (11.7.99)
    Requirement already satisfied: nvidia-cublas-cu11==11.10.3.66 in ./.local/lib/python3.10/site-packages (from torch>=1.3.0->stanza==1.1.1->argostranslate) (11.10.3.66)
    Requirement already satisfied: typing-extensions in ./.local/lib/python3.10/site-packages (from torch>=1.3.0->stanza==1.1.1->argostranslate) (4.4.0)
    Requirement already satisfied: nvidia-cudnn-cu11==8.5.0.96 in ./.local/lib/python3.10/site-packages (from torch>=1.3.0->stanza==1.1.1->argostranslate) (8.5.0.96)
    Requirement already satisfied: nvidia-cuda-runtime-cu11==11.7.99 in ./.local/lib/python3.10/site-packages (from torch>=1.3.0->stanza==1.1.1->argostranslate) (11.7.99)
    Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from nvidia-cublas-cu11==11.10.3.66->torch>=1.3.0->stanza==1.1.1->argostranslate) (59.6.0)
    Requirement already satisfied: wheel in /usr/lib/python3/dist-packages (from nvidia-cublas-cu11==11.10.3.66->torch>=1.3.0->stanza==1.1.1->argostranslate) (0.37.1)
    me@me-pc:~$
    

    Warnings had disappeared, which I thought was a good sign. But Argos still not in Menu, and when I ran argos-translate or argos-translate-gui in Terminal, answer was: Illegal instruction (core dumped) What does it mean??

    So I tried to follow the found web pages, and then I added the indicated folder for the PATH in 2 other files: PATH="$PATH:/home/me/.local/bin" in /home/me/.profile and in /etc/environment and I restarted the computer. But then surprise, at session opening, I coudn't enter, cause after each confirmation of my password, the login page displayed again and asked me again the password! So from another OS, I entered my partition and I commented with # the 2 lines I had added. And then I could re-open my session normally.

    Then I tried once more to add the folder in PATH, in etc/environment there is a line, in which I added it to the end: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/me/.local/bin" And then I restarted, but still the same (I keep this modification for the moment).

    I see yet 10 things to try, but it might take hours or days and might finally work or break my partition, so if someone has the right answer it would be great.

    opened by user0022 0
  • Translation from English to Catalan hallucinates often

    Translation from English to Catalan hallucinates often

    How to reproduce, clean installation doing:

    • pip install argostranslate
    • argos-translate --from en --to ca < text.txt

    See a sample below. The test "© 2019 Màrqueting digital de BookingSuite" is not present in the English sample.

    The models trained at Softcatalà with the same corpus do not show this problem.

    English text

    "A new policy now prohibits linking to other social media in any way, including (but not limited to!) fediverse / #Mastodon URLS. I will not participate in an explicitly walled garden.

    help.twitter.com/en/rules-and-...

    Those who stay are putting themselves at risk, and I tried to sound the warning for weeks. I'm done. It's nicer here"

    Catalan text

    "Una nova política prohibeix ara la vinculació amb altres xarxes socials de qualsevol manera, incloent (però no limitat a!) fediverse / #Mastodon URLS. No participaré en un jardí de paret explícita.

    © 2019 Màrqueting digital de BookingSuite. BookingSuite és una marca de Booking.com. Estaràs en bones mans: pots confiar en el gran servei d'Atenció al client que proporciona Booking.com

    Els que s'allotgen es posen en risc, i he intentat sonar l'avís durant setmanes. He acabat. És més bonic

    opened by jordimas 2
  • SyntaxError: future feature annotations is not defined

    SyntaxError: future feature annotations is not defined

    Hello, I have the following problem:

    Traceback (most recent call last):
      File "create_augs.py", line 4, in <module>
        from augmentation.main import text_augmentation2
      File "/home/USER/Code/show-attend-tell/augmentation/main.py", line 2, in <module>
        from .backtranslate import backtranslation
      File "/home/USER/Code/show-attend-tell/augmentation/backtranslate.py", line 6, in <module>
        from argostranslate import package, translate
      File "/home/USER/.local/lib/python3.6/site-packages/argostranslate/package.py", line 1
        from __future__ import annotations
        ^
    SyntaxError: future feature annotations is not defined
    

    I am running the code on Python 3.6 with the latest Argostranslate version. What could be the issue? Thanks!

    opened by aliciaviernes 1
  • Support for upper case text

    Support for upper case text

    Argos-transalate is unable to translate text in upper case.

    See as example:

    argos-translate --from en --to es "Hello World"
    Hola Mundo
    
    argos-translate --from en --to es "HELLO WORLD"
    HELLO WORLD
    

    Happy to discuss and suggest potential solutions

    opened by jordimas 0
  • Czech translations are awkward or wrong

    Czech translations are awkward or wrong

    I'm guessing there needs to be more czech material fed into the network. Currently, the output of czech-to-english translation very often produces incorrect translations. I've seen in get "confused" by subject vs. object and swapping them, or dropping the subject and using "you" instead. (These were real world examples I saw when playing around with mastodon libretranslate integration.)

    On a more "unit test" level, things are weird. I played with libretranslate.com's english->czech translation. Here are some samples:

    • "hello" is translated as "čeština" (meaning "czech language") instead of "ahoj" among other possibilities
    • "Hello" -> "Dobrý den" ("good day") which is acceptable
    • "bye" -> "podle" ("according to") which is wrong
    • "Bye" -> "Čeština" ("czech language") which is wrong
    • "Cats love hats" -> "Kočky milují klobouky" is spot on
    • "cats love hats" -> "kočky láska čepice" ("cats, love, caps/hats") is wrong as a sentence but right as a list of nouns

    It looks like the model is fixated on capitalization and to a lesser extend punctuation. (Czech, of course, has rules about all that, but not all text that is likely to be translated will be well-formed. E.g., mastodon posts.)

    Anyway, I thought I'd file this as an FYI about the en<->cz translation quality.

    opened by jeffpc 0
Open Source Neural Machine Translation in PyTorch

OpenNMT-py: Open-Source Neural Machine Translation OpenNMT-py is the PyTorch version of the OpenNMT project, an open-source (MIT) neural machine trans

OpenNMT 5.8k Jan 4, 2023
Open Source Neural Machine Translation in PyTorch

OpenNMT-py: Open-Source Neural Machine Translation OpenNMT-py is the PyTorch version of the OpenNMT project, an open-source (MIT) neural machine trans

OpenNMT 4.8k Feb 18, 2021
Neural-Machine-Translation - Implementation of revolutionary machine translation models

Neural Machine Translation Framework: PyTorch Repository contaning my implementa

Utkarsh Jain 1 Feb 17, 2022
A Python wrapper for simple offline real-time dictation (speech-to-text) and speaker-recognition using Vosk.

Simple-Vosk A Python wrapper for simple offline real-time dictation (speech-to-text) and speaker-recognition using Vosk. Check out the official Vosk G

null 2 Jun 19, 2022
Training open neural machine translation models

Train Opus-MT models This package includes scripts for training NMT models using MarianNMT and OPUS data for OPUS-MT. More details are given in the Ma

Language Technology at the University of Helsinki 167 Jan 3, 2023
Python-zhuyin - An open source Python library that provides a unified interface for converting between Chinese pinyin and Zhuyin (bopomofo)

Python-zhuyin - An open source Python library that provides a unified interface for converting between Chinese pinyin and Zhuyin (bopomofo)

null 2 Dec 29, 2022
voice2json is a collection of command-line tools for offline speech/intent recognition on Linux

Command-line tools for speech and intent recognition on Linux

Michael Hansen 988 Jan 4, 2023
Partially offline multi-language translator built upon Huggingface transformers.

Translate Command-line interface to translation pipelines, powered by Huggingface transformers. This tool can download translation models, and then us

Richard Jarry 8 Oct 25, 2022
Utility for Google Text-To-Speech batch audio files generator. Ideal for prompt files creation with Google voices for application in offline IVRs

Google Text-To-Speech Batch Prompt File Maker Are you in the need of IVR prompts, but you have no voice actors? Let Google talk your prompts like a pr

Ponchotitlán 1 Aug 19, 2021
This is the offline-training-pipeline for our project.

offline-training-pipeline This is the offline-training-pipeline for our project. We adopt the offline training and online prediction Machine Learning

null 0 Apr 22, 2022
Official codebase for Can Wikipedia Help Offline Reinforcement Learning?

Official codebase for Can Wikipedia Help Offline Reinforcement Learning?

Machel Reid 82 Dec 19, 2022
An open source library for deep learning end-to-end dialog systems and chatbots.

DeepPavlov is an open-source conversational AI library built on TensorFlow, Keras and PyTorch. DeepPavlov is designed for development of production re

Neural Networks and Deep Learning lab, MIPT 6k Dec 30, 2022
An open-source NLP research library, built on PyTorch.

An Apache 2.0 NLP research library, built on PyTorch, for developing state-of-the-art deep learning models on a wide variety of linguistic tasks. Quic

AI2 11.4k Jan 1, 2023
An open source library for deep learning end-to-end dialog systems and chatbots.

DeepPavlov is an open-source conversational AI library built on TensorFlow, Keras and PyTorch. DeepPavlov is designed for development of production re

Neural Networks and Deep Learning lab, MIPT 6k Dec 31, 2022
An open-source NLP research library, built on PyTorch.

An Apache 2.0 NLP research library, built on PyTorch, for developing state-of-the-art deep learning models on a wide variety of linguistic tasks. Quic

AI2 9.7k Feb 18, 2021
An open source library for deep learning end-to-end dialog systems and chatbots.

DeepPavlov is an open-source conversational AI library built on TensorFlow, Keras and PyTorch. DeepPavlov is designed for development of production re

Neural Networks and Deep Learning lab, MIPT 5k Feb 18, 2021
A deep learning-based translation library built on Huggingface transformers

DL Translate A deep learning-based translation library built on Huggingface transformers and Facebook's mBART-Large ?? GitHub Repository ?? Documentat

Xing Han Lu 244 Dec 30, 2022
Saptak Bhoumik 14 May 24, 2022