示例#1
0
def gen_match_objs(task_id, match_type, source_vectors, target_vectors):
    matches = match_type.match(source_vectors, target_vectors)
    for source, source_instance, target, target_instance, score in matches:
        mat = Match(task_id=task_id,
                    from_vector_id=source,
                    to_vector_id=target,
                    from_instance_id=source_instance,
                    to_instance_id=target_instance,
                    score=score,
                    type=match_type.match_type)
        yield mat
示例#2
0
文件: tasks.py 项目: babanati/rematch
def gen_match_objs(task_id, step, source_vectors, target_vectors):
    matches = step.gen_matches(source_vectors, target_vectors)
    for source_instance, target_instance, score in matches:
        if score < 50:
            continue
        mat = Match(task_id=task_id,
                    from_instance_id=source_instance,
                    to_instance_id=target_instance,
                    score=score,
                    type=step.get_match_type())
        yield mat
示例#3
0
def gen_match_objs(task_id, step, source_vectors, target_vectors, local_ids,
                   remote_ids):
    matches = step.gen_matches(source_vectors, target_vectors)
    for source_instance, target_instance, score in matches:
        if not np.isfinite(score):
            print("Infinite score detected: {} in step {} between {} and {}"
                  "".format(score, step, source_instance, target_instance))
            continue
        if score < 50:
            continue
        mat = Match(task_id=task_id,
                    from_instance_id=source_instance,
                    to_instance_id=target_instance,
                    score=score,
                    type=step.get_match_type())
        local_ids.add(source_instance)
        remote_ids.add(target_instance)
        yield mat