def calc_jaccard_score(span_1: dict, span_2: dict) -> float:
    """Calculate the jaccard score of the provided spans of tags.
    Jaccard index = Intersection of argument list / Union of argument list

    Ref: https://en.wikipedia.org/wiki/Jaccard_index

    Args:
        span_1 (dict): first span of tags. Format:
        {IndexOfTokenInSentence:
                "tag",
        ...
        }
        span_2 (dict): second span of tags. Format:
        {IndexOfTokenInSentence:
                "tag",
        ...
        }
    Returns:
        float: jaccard score for the given spans.
    """
    s1 = set(span_1)
    s2 = set(span_2)
    j_union = s1.union(s2)
    j_intersection = 0
    for sent_index in j_union:
        if sent_index in span_1 and sent_index in span_2:
            if span_1[sent_index] == span_2[sent_index]:
                # both spans have the same tag at the same position.
                j_intersection += 1
            elif span_1[sent_index] in ["B", "I"] and span_2[sent_index] in ["B", "I"]:
                # both spans have either a 'B' or an 'I' tag are the same position.
                # Thus, both spans of 'BI' tags intersect at this position.
                j_intersection += 1
        else:
            pass
    js = float(j_intersection / len(j_union))
    return js