|
@@ -14,6 +14,7 @@ from utils.label_data_Hphy import Label
|
|
|
from bisect import bisect_left
|
|
|
import re, time, os, json, datetime
|
|
|
from copy import deepcopy
|
|
|
+import traceback
|
|
|
|
|
|
logger = configs.myLog(__name__, log_cate="ruku_log").getlog()
|
|
|
|
|
@@ -502,6 +503,7 @@ class Ruku():
|
|
|
return res_zyk
|
|
|
except Exception as e:
|
|
|
print("------【paper_id:{}】最后的保存失败:{}-------".format(self.wordid, str(e)))
|
|
|
+ print(traceback.print_exc())
|
|
|
logger.info(json.dumps({"log_level": "warn",
|
|
|
"paper_id": self.wordid,
|
|
|
"status": "入库失败",
|
|
@@ -609,7 +611,7 @@ class Ruku():
|
|
|
# -----------难度和知识点自动标注------------------------
|
|
|
t11 = time.time()
|
|
|
diffs_xbk = [""] * len(items_res_to_zyk)
|
|
|
- if self.subject == "高中数学":
|
|
|
+ if self.subject == 3: # "高中数学"
|
|
|
from multiprocessing.dummy import Pool as ThreadPool
|
|
|
pool = ThreadPool(2) # 比# pool = multiprocessing.Pool(3)速度快
|
|
|
diff_info = list(pool.map(get_item_diff, items_res_to_zyk))
|
|
@@ -622,7 +624,7 @@ class Ruku():
|
|
|
t22 = time.time()
|
|
|
# print(one_items)
|
|
|
chachong_item_dict = {"topic_id": id + 1,
|
|
|
- "subject_id": subject_id[self.subject],
|
|
|
+ "subject_id": self.subject,
|
|
|
"topic_type_id": one_items["checkType"]["id"],
|
|
|
"content": one_items["stem"]}
|
|
|
if "options" in one_items:
|