At each time step j, it generates y j based on the current LSTM hidden state s j , a summary of the input context c j , and attention scores a ji , which are used for attention-based copying as in (Jia and Liang, 2016).
where y j = w denotes that y j is chosen from the output vocabulary V out ; y j = u i denotes that y j is a copy of u i ; a ji = s T j W a h i is an attention score on the input word is a context vector that summarizes the encoder states; and W o and W a are matrix parameters to be learned.