Argos Translate Documentation

repository·master·Indexed 27 days ago

https://github.com/argosopentech/argos-translate

An open-source offline translation library written in Python that serves as the engine for LibreTranslate. It can be used as a Python library, a command-line tool (via argos-translate and argospm), or a GUI application. The library utilizes OpenNMT, SentencePiece, and Stanza, supporting language model packages in .argosmodel format and automatic pivoting between languages.

Tokens
4.9K
Snippets
27
Records
40
Agent score
89%

What's inside Argos Translate

  1. Overview of Argos Translate

    master

    Argos Translate is an open-source offline translation library written in Python. It utilizes OpenNMT for translations, SentencePiece for tokenization, Stanza for sentence boundary detection, and PyQt for its GUI.

    It can be used in three ways:

    1. As a Python library for programmatic integration.
    2. As a Command Line Interface (CLI) for quick translations.
    3. As a GUI application.

    Key features include:

    • Language Model Packages: Supports installing .argosmodel zip archives containing translation data.
    • Automatic Pivoting: If a direct translation between two languages is not installed, Argos Translate can automatically pivot through an intermediate language (e.g., translating es ➔ fr using es ➔ en and en ➔ fr models) to enable translation between a wider variety of languages.
  2. Import `.argosmodel` files through the GUI

    master

    If you have manually downloaded language pair models (from argospm or the argospm-index GitHub), follow these steps to install them:

    1. Run argos-translate-gui.
    2. Click on the Manage Packages menu item.
    3. Click on the Install package file button.
    4. Navigate to and select your .argosmodel file, then click Open.
    5. Repeat for all downloaded files.
    6. Close the Manage Packages window using the X in the top right.
  3. Install Argos Translate from source into a virtualenv

    master

    If you prefer to install from the source repository, follow these steps to set up a virtual environment and install in editable mode:

    1. Clone the repository.
    2. Create and activate a virtual environment.
    3. Install the package using pip install -e .
    git clone https://github.com/argosopentech/argos-translate.git
    cd argos-translate
    virtualenv env
    source env/bin/activate
    pip install -e .
  4. Download Argos Translate via Torrents

    master

    Argos Translate provides peer-to-peer distribution options via BitTorrent for downloading language packages or library files. You can choose between standard torrent files or BitTorrent v2 compatible files depending on your client's support.

    ##### [Argos-Translate-LibreTranslate-2022-04-30.zip.torrent](https://github.com/argosopentech/argos-translate/raw/master/p2p/Argos-Translate-LibreTranslate-2022-04-30.zip.torrent)
    ##### [Argos-Translate-LibreTranslate-2022-04-30.torrent (requires BitTorrent v2)](https://github.com/argosopentech/argos-translate/raw/master/p2p/Argos-Translate-LibreTranslate-2022-04-30.torrent)
  5. Translate text using the GUI

    master

    The GUI uses two text boxes: the left box contains the source text, and the right box displays the translation.

    Workflow Example (Vietnamese to English):

    1. Set the left dropdown menu to Vietnamese.
    2. Set the right dropdown menu to English.
    3. Replace the default text in the left text box with your source text (use CTRL+a to select all and CTRL+v to paste).
    4. Wait for the translation to appear in the right text box.

    Note: If the output looks too similar to the input, verify that you have selected the correct origin language.

  6. Install new language pairs through the GUI

    master

    You can download language pair models (averaging 100MB each) directly within the application:

    1. Run argos-translate-gui.
    2. Click on the Manage Packages menu item.
    3. Click on the Download packages button.
    4. Click the down arrow beside the desired language pair.
    5. Wait for the hourglass icon to change into a check mark icon.
    6. Repeat for other pairs.
    7. Close the Download packages window and the Manage Packages window using the X in the top right.