def get_tokens(node, index):
    """
    Get the tokens from the leaf node
    Args:
    node: leaf node
    index: 0-token, 1-final, 2-sentence, 3-beat, 4-pos
    """
    sen = []
    while node:
        words = node.wordid[index][0].tolist()
        for w in words[::-1]:
            sen.append(w)
        node = node.prevNode
    return sen[::-1]