瀏覽代碼

增加大实体字典

luojiehua 2 年之前
父節點
當前提交
dd4e6356de
共有 3 個文件被更改,包括 15 次插入5 次删除
  1. 9 0
      BiddingKG/dl/entityLink/entityLink.py
  2. 4 4
      BiddingKG/readme/start.md
  3. 2 1
      BiddingKG/run_extract_server.py

+ 9 - 0
BiddingKG/dl/entityLink/entityLink.py

@@ -146,7 +146,16 @@ def get_nlp_enterprise(list_entity):
     return nlp_enterprise[:max_num],nlp_enterprise_attachment[:max_num]
 
 def getEnterprisePath():
+    filename_huge = "LEGAL_ENTERPRISE_HUGE.txt"
+    huge_path = getFileFromSysPath(filename_huge)
+    if huge_path is None:
+        if os.path.exists(huge_path):
+            return huge_path
+    else:
+        return huge_path
+
     filename = "LEGAL_ENTERPRISE.txt"
+
     real_path = getFileFromSysPath(filename)
     if real_path is None:
         real_path = filename

+ 4 - 4
BiddingKG/readme/start.md

@@ -8,8 +8,8 @@ cd /data/python
 #关闭接口
 ps -ef | grep run_extract_server | grep -v grep | cut -c 9-16| xargs kill -9
 #启动接口
-#nohup /data/anaconda3/envs/py37/bin/gunicorn -w 15 --limit-request-fields 0 --limit-request-line 0 -t 1000 --keep-alive 600 -b 0.0.0.0:15030 run_extract_server:app >> extract.log &
-nohup /data/anaconda3/envs/py37/bin/python run_extract_server.py >> extract.log port=15030 worker=14 &
+nohup /data/anaconda3/envs/py37/bin/gunicorn -w 15 --limit-request-fields 0 --limit-request-line 0 -t 1000 --keep-alive 600 -b 0.0.0.0:15030 run_extract_server:app >> extract.log &
+#nohup /data/anaconda3/envs/py37/bin/python run_extract_server.py >> extract.log port=15030 worker=14 &
 
 #19022启动要素提取接口
 #切换目录
@@ -17,5 +17,5 @@ cd /data/python
 #关闭接口
 ps -ef | grep run_extract_server | grep -v grep | cut -c 9-16| xargs kill -9
 #启动接口
-#nohup /data/anaconda3/envs/py37/bin/gunicorn -w 5 --limit-request-fields 0 --limit-request-line 0 -t 1000  --keep-alive 600 -b 0.0.0.0:15030 run_extract_server:app >> extract.log &
-nohup /data/anaconda3/envs/py37/bin/python run_extract_server.py >> extract.log port=15030 worker=7 &
+nohup /data/anaconda3/envs/py37/bin/gunicorn -w 5 --limit-request-fields 0 --limit-request-line 0 -t 1000  --keep-alive 600 -b 0.0.0.0:15030 run_extract_server:app >> extract.log &
+#nohup /data/anaconda3/envs/py37/bin/python run_extract_server.py >> extract.log port=15030 worker=7 &

+ 2 - 1
BiddingKG/run_extract_server.py

@@ -79,11 +79,12 @@ def run_thread(data,list_result):
     data_res = ""
 
     web_source_no = data.get("web_source_no","")
+    web_source_name = data.get("web_source_name","")
     original_docchannel = data.get("original_docchannel","")
     is_fail = False
     try:
         if _content!="":
-            data_res  = predict(_doc_id,_content,_title,_page_time,web_source_no,original_docchannel)
+            data_res  = predict(_doc_id,_content,_title,_page_time,web_source_no=web_source_no,web_source_name=web_source_name,original_docchannel=original_docchannel)
         else:
             data_res = json.dumps({"success":False,"msg":"content not passed"})
             # is_fail = True