Example code to create a machine translation using trax transformer model.
See original GitHub issueDescription
Hi, I am little new to this area. Please excuse me if I am asking any stupid question. I wanted to have machine translation model using Transformers and the model is trained on my own data. Can I get an example code where I can pass my own data as input (both input and target) to the trax transofrmers so that it can predict the translated value.
I will be using my own laptop for preparing and running the model. It does not have GPU.
Also if possible can I get an example code for speech recognition as well using the transformer model.
Thanks Nagaraju
…
Environment information
OS: <win10>
$ pip freeze | grep trax
# your output here
$ pip freeze | grep tensor
# your output here
$ pip freeze | grep jax
# your output here
$ python -V
# your output here
For bugs: reproduction and error logs
# Steps to reproduce:
...
# Error logs:
...
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (2 by maintainers)
 Top Results From Across the Web
Top Results From Across the Web
Neural machine translation with a Transformer and Keras | Text
This tutorial demonstrates how to create and train a sequence-to-sequence Transformer model to translate Portuguese into English. The Transformer was ...
Read more >NMT with Transformers/Reformers using Trax - Google Colab
A guide to Neural Machine Translation using Transformers/Reformers. Includes a detailed tutorial using Trax in Google Colaboratory. Machine translation is an ...
Read more >Get started with Google Trax for NLP - Towards Data Science
Use Trax pretrained models and build your own Models from scratch. ... Machine Translator and a Named Entity Recognition system with Trax.
Read more >trax-ml/community - Gitter
Hi a trax newbie here, in trax/trax/models/transformer.py the Transformer function, ... An example of how to create a whole input pipeline for IMDB...
Read more >Understanding introductory example on transformers in Trax
I found it out myself... one needs to reset the model's state . So the following code works for me: def translate(model, sentence, ......
Read more > Top Related Medium Post
Top Related Medium Post
No results found
 Top Related StackOverflow Question
Top Related StackOverflow Question
No results found
 Troubleshoot Live Code
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free Top Related Reddit Thread
Top Related Reddit Thread
No results found
 Top Related Hackernoon Post
Top Related Hackernoon Post
No results found
 Top Related Tweet
Top Related Tweet
No results found
 Top Related Dev.to Post
Top Related Dev.to Post
No results found
 Top Related Hashnode Post
Top Related Hashnode Post
No results found

It’s a very good idea - we’ll try to add a colab soon doing just that!
@lukaszkaiser Thanks for the response 👍 Unfortunately I am not able to run the code on my windows laptop. I tried to install trax using pip install trax. But it failed at jaxlib with following error. ERROR: Could not find a version that satisfies the requirement tensorflow-text (from trax) (from versions: none) ERROR: No matching distribution found for tensorflow-text (from trax)
In the notebook, I could see trax is listed as module but when I run the code it is giving “No module named trax”