Merge two predictions into one. Assumes the predicate in tags1 overlap with
    the predicate of tags2.

def merge_overlapping_predictions(tags1: List[str], tags2: List[str]) -> List[str]:
    """
    Merge two predictions into one. Assumes the predicate in tags1 overlap with
    the predicate of tags2.
    """
    ret_sequence = []
    prev_label = "O"

    # Build a coherent sequence out of two
    # spans which predicates' overlap

    for tag1, tag2 in zip(tags1, tags2):
        label1 = tag1.split("-")[-1]
        label2 = tag2.split("-")[-1]
        if (label1 == "V") or (label2 == "V"):
            # Construct maximal predicate length -
            # add predicate tag if any of the sequence predict it
            cur_label = "V"

        # Else - prefer an argument over 'O' label
        elif label1 != "O":
            cur_label = label1
        else:
            cur_label = label2

        # Append cur tag to the returned sequence
        cur_tag = get_coherent_next_tag(prev_label, cur_label)
        prev_label = cur_label
        ret_sequence.append(cur_tag)
    return ret_sequence