REUP and change the question.
I uploaded the word matrix of embeddings inside the LSTM as follows:
weights = torch.FloatTensor(np.load('embeddings.npy'))```


class lstm(nn.Module):
def __init__(self, embedding_dim, hidden_dim, vocab_size, tagset_size, matrix_embeddings):
    super(lstm, self).__init__()
    #dimensionalities
    self.embedding_dim = embedding_dim
    self.vocab_size = vocab_size
    self.hidden_dim = hidden_dim

    #embedding
    self.embeddings = nn.Embedding.from_pretrained(matrix_embeddings)
    self.embeddings.requires_grad = False

    # The LSTM takes word embeddings as inputs, and outputs hidden states
    # with dimensionality hidden_dim.
    self.lstm = nn.LSTM(embedding_dim, hidden_dim)

    # The linear layer that maps from hidden state space to tag space
    self.hidden2tag = nn.Linear(hidden_dim, tagset_size)

def forward(self, sentence):
    embeds = self.word_embeddings(sentence)
    lstm_out, _ = self.lstm(embeds.view(len(sentence), 1, -1))
    tag_space = self.hidden2tag(lstm_out.view(len(sentence), -1))
    tag_scores = F.log_softmax(tag_space, dim=1)
    return tag_scores```

Now I have some questions. First questions is how I have to proceed? How can the LSTM know that the word “Home” belongs to the index 787 of the embeddings matrix?
I don’t understand how to build an LSTM network for word prediction and i need your help guys