-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Natural Language Processing with TensorFlow
By :

Inferencing is slightly different from the training process for NMT (Figure 10.11). As we do not have a target sentence at the inference time, we need a way to trigger the decoder at the end of the encoding phase. This shares similarities with the image captioning exercise we did in Chapter 9, Applications of LSTM – Image Caption Generation. In that exercise, we appended the <SOS> token to the beginning of the captions to denote the start of the caption and <EOS> to denote the end.
We can simply do this by giving <s> as the first input to the decoder, then by getting the prediction as the output, and by feeding in the last prediction as the next input to the NMT:
Preprocess xs as explained previously
Figure 10.11: Inferring...