|
@@ -36,10 +36,8 @@ class AccountServer(object):
|
|
"score_list_b": account_weight,
|
|
"score_list_b": account_weight,
|
|
"symbol": 1,
|
|
"symbol": 1,
|
|
},
|
|
},
|
|
- "function": "similarities_cross_avg"
|
|
|
|
|
|
+ "function": "similarities_cross_mean" if self.sim_type == "mean" else "similarities_cross_avg"
|
|
}
|
|
}
|
|
- print(json.dumps(body, ensure_ascii=False, indent=4))
|
|
|
|
-
|
|
|
|
async with aiohttp.ClientSession() as session:
|
|
async with aiohttp.ClientSession() as session:
|
|
async with session.post(url, headers=headers, json=body) as response:
|
|
async with session.post(url, headers=headers, json=body) as response:
|
|
response_text = await response.text()
|
|
response_text = await response.text()
|
|
@@ -114,19 +112,18 @@ class AccountServer(object):
|
|
# try:
|
|
# try:
|
|
account_interest, account_weight = await self.getAccountInterest(
|
|
account_interest, account_weight = await self.getAccountInterest(
|
|
account_name=account_name,
|
|
account_name=account_name,
|
|
- method=self.sim_type,
|
|
|
|
|
|
+ method=self.interest_type,
|
|
rate=self.rate
|
|
rate=self.rate
|
|
)
|
|
)
|
|
|
|
+ sim_key = "score_list_mean" if self.sim_type == "mean" else "score_list_avg"
|
|
response = await self.request_for_nlp(
|
|
response = await self.request_for_nlp(
|
|
title_list=self.title_list,
|
|
title_list=self.title_list,
|
|
account_interest=account_interest,
|
|
account_interest=account_interest,
|
|
- account_weight=account_weight,
|
|
|
|
|
|
+ account_weight=account_weight
|
|
)
|
|
)
|
|
- res = response
|
|
|
|
- sim_key = "score_list_mean" if self.sim_type == "mean" else "score_list_avg"
|
|
|
|
return {
|
|
return {
|
|
- "score_list": res[sim_key],
|
|
|
|
- "text_list_max": res["text_list_max"],
|
|
|
|
|
|
+ "score_list": response[sim_key],
|
|
|
|
+ "text_list_max": response["text_list_max"],
|
|
}
|
|
}
|
|
# except Exception as e:
|
|
# except Exception as e:
|
|
# print(e)
|
|
# print(e)
|