def read_vocab(vocab_file):
    """
    讀取 vocab_file，回傳 vocab <-> id 雙向的字典

    Args:
        vocab_file:
            input_vocab_file_path

    Returns:
        vocab2id:
            {'<UKN>': 0,
             '扎': 1,
             '遺': 2,
             ...}

        id2vocab:
            {0: '<UKN>',
             1: '扎',
             2: '遺',
             ...}
    """
    vocab2id = {}
    id2vocab = {}
    for index, line in enumerate(
        [line.strip() for line in open(vocab_file, "r", encoding="UTF8").readlines()]
    ):
        vocab2id[line] = index
        id2vocab[index] = line
    return vocab2id, id2vocab