def _predict_next_word_topk(self, sentence_list: list, topK=5):
    test_item = torch.tensor([[self._word_vocab.stoi[x]] for x in sentence_list], device=DEVICE)
    predict_softmax = torch.softmax(self._model(test_item)[(- 1)], dim=0).cpu().data
    (topK_prob, topK_index) = torch.topk(predict_softmax, topK)
    topK_prob = topK_prob.tolist()
    topK_vocab = [self._word_vocab.itos[x] for x in topK_index]
    return list(zip(topK_vocab, topK_prob))
def _predict_next_word_topk(self, sentence_list: list, topK=5):
    test_item = torch.tensor([[self._word_vocab.stoi[x]] for x in sentence_list], device=DEVICE)
    predict_softmax = torch.softmax(self._model(test_item)[(- 1)], dim=0).cpu().data
    (topK_prob, topK_index) = torch.topk(predict_softmax, topK)
    topK_prob = topK_prob.tolist()
    topK_vocab = [self._word_vocab.itos[x] for x in topK_index]
    return list(zip(topK_vocab, topK_prob))