def line_up_ids()

in deploy_code/multipagepdfa2i_humancomplete/clean_data.py [0:0]


def line_up_ids(kv, line, word):
    kv_list = []
    master_values = []
    for cur in kv:
        if kv[cur]["entityTypes"][0] == "KEY":
            value = []
            text = ""
            for relation in kv[cur]["relationships"]:
                if relation["type"] == "VALUE":
                    for id in relation["ids"]:
                        value.append(id)
                if relation["type"] == "CHILD":
                    text = get_child(relation, line, word)
            kv_list.append({
                "value": extract_value(value, kv, line, word),
                "key": text               
            })
    return kv_list