Let us take an example to understand the notation. Let us build a sequence model to input a sentence and the model will tell us where the peoples names are in this sentence. This is a problem called Named-entity recognition and is used by search engines for example to index all the people mentioned in the news articles so that they can index them appropriately.

Suppose we have the input :

then we want a model to output which has one output per input word and it tells you for each input if the word is a person’s name or not. So here the output is :

Now, the input is a sequence of nine words. We use the notation to denote the word. Therefore in this example denotes the word . Similarly for the output we use the notation . So here is used to denoted .

We use to denote the length of the input sequence and to denote the length of the output sequence. In this case we have .

Now if we have multiple training examples., in-order to denote the examples word we use the following notation : . Now different training examples can have different length, so is used to denote the length of the example.

Vocabulary

So to represent a word in a sentence the first thing we should do is come up with a Vocabulary. Suppose the word Harry appears in position , Potter in position and the word Zulu which is the last word of the dictionary appears at position .

Now in order to represent the word Harry, we use one hot representations. Here for , the vector will have all zeros except a at the position. Each word is represented with a dimension vector.

So the above input sequence can be shown as 9 one hot encoded vectors of dimension .

Now we want this network to learn how to map this input to the output . For this purpose we use Recurrent Neural Networks.