Browse Source

修复完成

罗俊辉 9 months ago
parent
commit
e1a86c01e2
3 changed files with 24 additions and 24 deletions
  1. 22 22
      routes/accountServer.py
  2. 1 1
      test/nlp_dev.py
  3. 1 1
      test/rank_dev.py

+ 22 - 22
routes/accountServer.py

@@ -110,28 +110,28 @@ class AccountServer(object):
         获取和单个账号的相关性分数
         :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):
         """

+ 1 - 1
test/nlp_dev.py

@@ -192,7 +192,7 @@ def test_request(url):
     print(b - a)
 
 
-url_list = ["http://192.168.100.31:6062/nlp"]
+url_list = ["http://192.168.100.31:6060/nlp"]
 test_request(url_list[0])
 # with ThreadPoolExecutor(max_workers=3) as Pool:
 #     Pool.map(test_request, url_list)

File diff suppressed because it is too large
+ 1 - 1
test/rank_dev.py


Some files were not shown because too many files changed in this diff