def compare(initial, candidate):
    """
    Compares two shingles sequence and returns similarity value.
    :param initial: initial sentence shingles sequence
    :param candidate: compared sentence shingles sequence
    :return: similarity value
    """
    matches = 0
    for shingle in initial:
        if shingle in candidate:
            matches += 1

    return matches * 2 / float(len(initial) + len(candidate)) * 100