def strike_a_match(str1, str2):
    """Implements Dice Bi-Grams metric.

    str1, str2: str
        Input values in unicode.

    Returns
    -------
    float
        A similarity score normalized in range [0,1].
    """
    pairs1 = {str1[i:i + 2] for i in range(len(str1) - 1)}
    pairs2 = {str2[i:i + 2] for i in range(len(str2) - 1)}
    union = len(pairs1) + len(pairs2)
    hit_count = 0
    for x in pairs1:
        for y in pairs2:
            if x == y:
                hit_count += 1
                break
    try:
        return (2.0 * hit_count) / union
    except:
        if str1 == str2:
            return 1.0
        else:
            return 0.0