question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Example code to create a machine translation using trax transformer model.

See original GitHub issue

Description

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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
lukaszkaisercommented, Jul 17, 2020

It’s a very good idea - we’ll try to add a colab soon doing just that!

0reactions
nag0811commented, Jul 29, 2020

@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”

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found