def decode_story(id2word, result):
    """
    :param id2word: vocab
    :param result: (batch_size, story_size, seq_length)
    :return:
    out: a list of stories. the size of the list is batch_size
    """
    batch_size, story_size, seq_length = result.size()
    out = []
    for i in range(batch_size):
        txt = ''
        for j in range(story_size):
            for k in range(seq_length):
                vocab_id = result[i, j, k]
                if vocab_id != 2:
                    txt = txt + ' ' + id2word[int(vocab_id.item())]
                else:
                    break
        out.append(txt)
    return out