def get_score(words_from_dialog, subs):
    """
    :param subs: A list containing the substitles we try to match to this dialog line. sub.txt has to be BOW.
    :param words_from_dialog:  A dialog line (i.e. a character's dialog block from the screenplay) in BOW representation.
    :return: the matching's score.
    """
    # will run untill match cannot improve anymore
    try:
        words_from_subtitles = frozenset.union(*(sub.txt for sub in subs))
    except TypeError:
        # no subtitles
        words_from_subtitles = frozenset()

    # calculate BOW intersection and union
    intersection = len(words_from_dialog & words_from_subtitles)
    union = len(words_from_dialog | words_from_subtitles)

    return intersection / union