Machine Translation Web Interface for OpenNMT

You might want to build a GUI for your Machine Translation model to show to a client or to be able to translate sentences online. I have created a simple web interface for OpenNMT which depends on Python Flask and Flask-PageDown libraries.

To be able to use the web interface, you need first to implement an OpenNMT Rest API Server as explained by Paul Tardy in his tutorial, Simple OpenNMT-py REST server. Then, you can use the web interface to route the translation requests to the REST server that hosts your OpenNMT models.

You can find the code of the machine translation web interface at:

You need to modify the code adding the REST server url of your language pair. You can also apply your own tokenization or pre-processing on the source and post-processing on the output text as you need.

Feel free to check my live implementation of this web interface at

If you have questions, please let me know.

Rating: 5.0/5. From 1 vote.
Please wait...

Leave a Reply

Your email address will not be published. Required fields are marked *