I’m in trouble with the task of predicting the next word given a sequence of words with a LSTM model. I built the embeddings with Word2Vec for my vocabulary of words taken from different books. I create a list with all the words of my books (A flatten big book of my books). I created sequences of sentences of length N (with N fixed, for example sequences of length 6) and i shuffled these lists for the model in order to create training set, validation set and test set.
Now I’m a bit confused. Given a sentence, the network should predict each element of the sequence, so if i give the sentence “The cat is on the table with Anna”, the network takes “The” and try to predict “Cat” which is part of the sentence, so there is a ground truth, and so on
Is this procedure correct? I don’t know how to implement it with Pytorch.