|
@@ -110,28 +110,28 @@ class AccountServer(object):
|
|
获取和单个账号的相关性分数
|
|
获取和单个账号的相关性分数
|
|
:return:
|
|
:return:
|
|
"""
|
|
"""
|
|
- # try:
|
|
|
|
- account_interest, account_weight = await self.getAccountInterest(
|
|
|
|
- account_name=account_name,
|
|
|
|
- method=self.interest_type,
|
|
|
|
- rate=self.rate
|
|
|
|
- )
|
|
|
|
- sim_key = "score_list_mean" if self.sim_type == "mean" else "score_list_avg"
|
|
|
|
- response = await self.request_for_nlp(
|
|
|
|
- title_list=self.title_list,
|
|
|
|
- account_interest=account_interest,
|
|
|
|
- account_weight=account_weight
|
|
|
|
- )
|
|
|
|
- return {
|
|
|
|
- "score_list": response[sim_key],
|
|
|
|
- "text_list_max": response["text_list_max"],
|
|
|
|
- }
|
|
|
|
- # except Exception as e:
|
|
|
|
- # print(e)
|
|
|
|
- # return {
|
|
|
|
- # "score_list": [0] * len(self.title_list),
|
|
|
|
- # "text_list_max": self.title_list,
|
|
|
|
- # }
|
|
|
|
|
|
+ try:
|
|
|
|
+ account_interest, account_weight = await self.getAccountInterest(
|
|
|
|
+ account_name=account_name,
|
|
|
|
+ method=self.interest_type,
|
|
|
|
+ rate=self.rate
|
|
|
|
+ )
|
|
|
|
+ sim_key = "score_list_mean" if self.sim_type == "mean" else "score_list_avg"
|
|
|
|
+ response = await self.request_for_nlp(
|
|
|
|
+ title_list=self.title_list,
|
|
|
|
+ account_interest=account_interest,
|
|
|
|
+ account_weight=account_weight
|
|
|
|
+ )
|
|
|
|
+ return {
|
|
|
|
+ "score_list": response[sim_key],
|
|
|
|
+ "text_list_max": response["text_list_max"],
|
|
|
|
+ }
|
|
|
|
+ except Exception as e:
|
|
|
|
+ print(e)
|
|
|
|
+ return {
|
|
|
|
+ "score_list": [0] * len(self.title_list),
|
|
|
|
+ "text_list_max": self.title_list,
|
|
|
|
+ }
|
|
|
|
|
|
async def getAccountListScoreList(self):
|
|
async def getAccountListScoreList(self):
|
|
"""
|
|
"""
|