tacrev icon indicating copy to clipboard operation
tacrev copied to clipboard

[Possible BUG] Span Distance Calculation

Open gstoica27 opened this issue 3 years ago • 0 comments

Hi, thanks a lot for your work and dataset release!

I was looking at the "group_overview" jupyter notebook to investigate model errors, and noticed that in the "SPAN_DISTANCE" function under "tacrev/analysis/erudite/prim_funcs.py" (line 87), the following is listed:

def SPAN_DISTANCE(span1: Tuple[int, int], span2: Tuple[int, int], absolute=False) -> str:
    """
    The distance between two spans
    """
    output = None
    try:
        output = span2[0] - span1[0]
    except Exception as e:
        ex = Exception(f"Unknown exception from [ SPAN_DISTANCE ]: {e}")
        raise(ex)
    else:
        return output

I may be wrong, but this appears to be computing the distances between span beginnings, rather than between the spans themselves. Should it instead be:

def SPAN_DISTANCE(span1: Tuple[int, int], span2: Tuple[int, int], absolute=False) -> str:
    """
    The distance between two spans
    """
    output = None
    try:
        output = span2[0] - span1[1]

    except Exception as e:
        ex = Exception(f"Unknown exception from [ SPAN_DISTANCE ]: {e}")
        raise(ex)
    else:
        return output

?

I.e. computing the distance between the end of the first span and the beginning of the second instead?

gstoica27 avatar Oct 06 '20 01:10 gstoica27