""" @author: luojunhui """ import json import time import requests from concurrent.futures.thread import ThreadPoolExecutor def score_list(account): """ url = "http://192.168.100.31:8179/score_list" url1 = "http://47.98.154.124:6060/score_list" # url1 = "http://localhost:6060/score_list" url2 = "http://192.168.100.31:6062/score_list" :param account: :return: """ url2 = "http://47.98.136.48:6060/score_list" body = { "account_nickname_list": [account], "text_list": [ "在俄罗斯买好地了,却发现没有公路、码头、仓储、燃气管道……”", "被霸占15年后成功收回,岛礁资源超100万吨,曾遭到美菲联手抢夺", "感人!河南姐弟被父母遗弃,7岁弟弟带着姐姐看病:别怕,以后我养", "山东26岁女子产下罕见“4胞胎”,丈夫却突然消失,婆婆:养不起" ], "max_time": None, "min_time": None, "interest_type": "avg", "sim_type": "mean", "rate": 0.1 } response = requests.post(url=url2, headers={}, json=body).json() print(json.dumps(response, ensure_ascii=False, indent=4)) return response if __name__ == '__main__': # a = time.time() # with ThreadPoolExecutor(max_workers=100) as pool: # pool.map(score_list, ["生活良读"] * 1) # b = time.time() # print(b - a) a = time.time() res = score_list("生活情感叁读") b = time.time() print(b - a)