"""
@author: luojunhui
"""
import requests


def similarity_between_title_list(target_title_list: list[str], base_title_list: list[str]) -> list[list[float]]:
    """
    cal the similarity between two list of title
    :param target_title_list: target title_list
    :param base_title_list: base title_list
    :return: list of similarity
    """
    url = 'http://61.48.133.26:6060/nlp'
    body = {
        "data": {
            "text_list_a": target_title_list,
            "text_list_b": base_title_list
        },
        "function": "similarities_cross",
        "use_cache": False
    }
    response_json = requests.post(url, json=body, timeout=120).json()
    score_array = response_json['score_list_list']
    return score_array

