Beispiel #1
0
def get_ensemble_vocabulary(vocab_path):
    vocs = [load_vocab(item) for item in vocab_path]
    voc_list = []

    tok_voc = vocs[:-1]
    lab_voc = vocs[-1]

    for item in tok_voc:
        vocab = {"inputs": item, "targets": lab_voc}
        voc_list.append(vocab)

    return voc_list
Beispiel #2
0
def get_vocabulary(vocab_path):
    tok_voc = load_vocab(vocab_path[0])
    lab_voc = load_vocab(vocab_path[1])
    vocabulary = {"inputs": tok_voc, "targets": lab_voc}

    return vocabulary