Compute a validation score for the possible match.

    The score is based on a similarity score of the authors sets and the maximum Jaccard index found between 2 titles:
    one from the record and one from the result title sets.

    If the computed score is higher than 0.5, then the match is valid, otherwise it is not.

    Args:
        record (dict): the given record we are trying to match with similar ones in INSPIRE.
        result (dict): possible match returned by the ES query that needs to be validated.

    Returns:
        bool: validation decision.

def authors_titles_validator(record, result):
    """Compute a validation score for the possible match.

    The score is based on a similarity score of the authors sets and the maximum Jaccard index found between 2 titles:
    one from the record and one from the result title sets.

    If the computed score is higher than 0.5, then the match is valid, otherwise it is not.

    Args:
        record (dict): the given record we are trying to match with similar ones in INSPIRE.
        result (dict): possible match returned by the ES query that needs to be validated.

    Returns:
        bool: validation decision.

    """
    record_authors = get_value(record, 'authors', [])
    result_authors = get_value(result, '_source.authors', [])

    author_score = compute_author_match_score(record_authors, result_authors)

    title_max_score = 0.0
    record_titles = get_value(record, 'titles.title', [])
    result_titles = get_value(result, '_source.titles.title', [])

    for cartesian_pair in product(record_titles, result_titles):
        record_title_tokens = get_tokenized_title(cartesian_pair[0])
        result_title_tokens = get_tokenized_title(cartesian_pair[1])
        current_title_jaccard = compute_jaccard_index(record_title_tokens, result_title_tokens)

        if current_title_jaccard > title_max_score and current_title_jaccard >= 0.5:
            title_max_score = current_title_jaccard

    return (author_score + title_max_score) / 2 > 0.5