How to do it...

We proceed with the recipe as follows:

  1. Clone NMT from GitHub:
git clone https://github.com/tensorflow/nmt/
  1. Download a training dataset. In this case, we will use the training set for translating from Vietnamese to English. Other datasets are available at https://nlp.stanford.edu/projects/nmt/ for additional languages, such as German and Czech:
nmt/scripts/download_iwslt15.sh /tmp/nmt_data
  1. Considering https://github.com/tensorflow/nmt/, we are going to define the first embedding layer. The embedding layer takes an input, the vocabulary size V, and the desired size of the output embedding space. The vocabulary size is such that only the most frequent words in V are considered for embedding, while all the others are mapped ...

Get TensorFlow 1.x Deep Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.