Browse Source

score_list接口

罗俊辉 10 months ago
parent
commit
198238c8b6
1 changed files with 6 additions and 9 deletions
  1. 6 9
      routes/accountServer.py

+ 6 - 9
routes/accountServer.py

@@ -36,10 +36,8 @@ class AccountServer(object):
                 "score_list_b": account_weight,
                 "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 session.post(url, headers=headers, json=body) as response:
                 response_text = await response.text()
@@ -114,19 +112,18 @@ class AccountServer(object):
         # try:
         account_interest, account_weight = await self.getAccountInterest(
             account_name=account_name,
-            method=self.sim_type,
+            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,
+            account_weight=account_weight
         )
-        res = response
-        sim_key = "score_list_mean" if self.sim_type == "mean" else "score_list_avg"
         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:
         #     print(e)