(anaphor, antecedent)
return "relative_overlap", overlap
Compute relative overlap of the mentions (ignoring case).

    For example, "the new president" and "the president" have relative overlap
    2/3.

    Args:
        anaphor (Mention): A mention.
        antecedent (Mention): Another mention, preceding the anaphor.

    Returns:
        The tuple ('relative_overlap', OVERLAP), where OVERLAP (a float) is
        the relative overlap of anaphor and antecedent.
Compute relative overlap of the mentions (ignoring case).
Compute relative overlap of the mentions ( ignoring case ) .
def relative_overlap(anaphor, antecedent):
    """ Compute relative overlap of the mentions (ignoring case).

    For example, "the new president" and "the president" have relative overlap
    2/3.

    Args:
        anaphor (Mention): A mention.
        antecedent (Mention): Another mention, preceding the anaphor.

    Returns:
        The tuple ('relative_overlap', OVERLAP), where OVERLAP (a float) is
        the relative overlap of anaphor and antecedent.
    """
    ana_tokens = set([tok.lower() for tok in anaphor.attributes["tokens"]])
    ante_tokens = set([tok.lower() for tok
                             in antecedent.attributes["tokens"]])

    overlap = len(ana_tokens & ante_tokens)/max(len(ana_tokens),
                                                len(ante_tokens))

    return "relative_overlap", overlap
def relative_overlap ( anaphor , antecedent ) : ana_tokens = set ( [ tok . lower ( ) for tok in anaphor . attributes [ "tokens" ] ] ) ante_tokens = set ( [ tok . lower ( ) for tok in antecedent . attributes [ "tokens" ] ] ) overlap = len ( ana_tokens & ante_tokens ) / max ( len ( ana_tokens ) , len ( ante_tokens ) ) return "relative_overlap" , overlap