def _predict_next_word_prob(self, sentence_list: list, next_word: str):
    test_item = torch.tensor([[self._word_vocab.stoi[x]] for x in sentence_list], device=DEVICE)
    predict_prob = torch.softmax(self._model(test_item)[(- 1)], dim=0).cpu().data
    next_word_index = self._word_vocab.stoi[next_word]
    return predict_prob[next_word_index]
def _predict_next_word_prob(self, sentence_list: list, next_word: str):
    test_item = torch.tensor([[self._word_vocab.stoi[x]] for x in sentence_list], device=DEVICE)
    predict_prob = torch.softmax(self._model(test_item)[(- 1)], dim=0).cpu().data
    next_word_index = self._word_vocab.stoi[next_word]
    return predict_prob[next_word_index]