This demo shows how to perform sequence-to-sequence prediction using the Layers API of TensorFlow.js.
It demonstrates loading a pretrained model hosted at a URL, using
tf.loadLayersModel()
The training data was 149,861 English-French sentence pairs available from http://www.manythings.org/anki.
To train the demo in JavaScript, do
yarn train ${DATA_PATH}
The model was trained in Node.js with Tensorflow.js, which the model code is converted from Python to TypeScript by @huan based on the translation.py example.
python python/translation.py ${DATA_PATH}
The model was trained in Python Keras, based on the lstm_seq2seq example.
To launch the demo, do
yarn
yarn watch