Skip to content

Host and Inference via pre-trained NMT models

License

Notifications You must be signed in to change notification settings

surrey-nlp/Local-NMT

 
 

Repository files navigation

logo        Surrey Institute for People-Centred AI Logo

Centre for Translation Studies NMT on Web (CTSNMT)

GitHub issues GitHub stars GitHub forks GitHub license Twitter Twitter Follow Twitter Follow


Welcome to the CTSNMT project repository. To use this codebase and host this application locally,

Clone the repository using:

    git clone https://github.com/surrey-nlp/Local-NMT.git

Installation ( necessary; but easy :) )

Step 1

git clone https://github.com/surrey-nlp/Local-NMT.git
cd Local-NMT

Step 2

pip install -r requirements.txt

Run

python app.py --port <VALUE>

(requires GPU for fast inference, slower inference with CPUs)

Now, you can open Browser and copy and paste URL indicated in prompt (http://localhost:5000)


User Interface


alt text


Yet to be added

  • Feedback support

Changelog after forking

20/03/2022 - 22/03/2022

  • Added support for uploading file and translating it, a download link is provided later.

11/03/2022 - 15/03/2022

  • Sentence Generation on source side for each of the 99 languages supported by the FB model.
  • Language Identification via the JS-based langid.py library. Supports 78 languages. Thanks to the developer! :)
  • Inference using trained NMT models from the folder "models" in CTSNMT root.
  • PORT value to be passed as an argparse parameter now. Use --port otherwise it defaults to using PORT 5000.
  • Interface cleaning.

10/03/2022

  • Added bertviz based visualization. Thanks to the developer! :)

09/03/2022

  • Alert boxes for missing parameters.
  • Copy button, and clear buttons added for ease.
  • langauges order changed to alphabetical (mostly).
  • Copy translation button to copy the translated text to clipboard.
  • Back-translate button to reverse the language pairs and back-translate the previous translated output.

08/03/2022

  • v1.0.0: Asynchrounous translation finally!
  • Use of Swagger API added, calls to API for translation (removed form submit).
  • Source and Target language selection via Python dictionary; removed dependency of data-id from HTML.
  • Changed model to FB M2M 418M for quick debugging.
  • resolved icon issue while selecting languages.
  • resolved "hidden input" dependencies, jquery based language selection using semantic ui default hidden fields.
  • navbar icon trimmed.
  • added collection of translated text to a file (step towards feedback)

01/01/2022

  • Added Semantic UI for searchable dropdown.
  • Added support for selection of source language.
  • POST request sends back previous source/target language pair (system defaults to translating for the last language pair, if languages not selected).
  • Added support for model change in HTML (Flask side pages to be added later).
  • Added CTS logo.

31/12/2021

  • v0.5.1: Changed model to Facebook M2M for supporting 100+ languages.
  • Tokenizer change.
  • Added target language change support via dropdown (source language change to be added later).
  • Flask hosting changed to 0.0.0.0 to support access throughout internal network.

License

CC-BY-SA 4.0

Packages

No packages published

Languages

  • CSS 42.0%
  • JavaScript 40.4%
  • Python 14.5%
  • HTML 2.7%
  • Jupyter Notebook 0.4%