3a4fd0b0 by 冯轩

Merge branch 'feature/CHINARPA-4495'

2 parents 47cb7170 90c104a9
......@@ -1507,7 +1507,7 @@ class Command(BaseCommand, LoggerMixin):
# AFC合同
if classify_1_str == str(consts.CONTRACT_CLASSIFY):
is_fsm = doc.is_ovp_fsm == 1
ocr_result = afc_predict(self,pdf_handler.pdf_info, is_fsm=is_fsm)
ocr_result = afc_predict(pdf_handler.pdf_info, is_fsm=is_fsm)
page_res = {}
for page_num, page_info in ocr_result.get('page_info', {}).items():
if isinstance(page_num, str) and page_num.startswith('page_'):
......
......@@ -24,7 +24,7 @@ def extract_info(ocr_results):
return {'page_1': {'合同编号': contract_no}}
def predict(self, pdf_info, is_qrs=False, is_fsm=False):
def predict(pdf_info, is_qrs=False, is_fsm=False):
pop_seceond_page_info = {}
if not is_fsm and not is_qrs and len(pdf_info) == 9:
pop_seceond_page_info = pdf_info.pop('1', {})
......@@ -61,10 +61,8 @@ def predict(self, pdf_info, is_qrs=False, is_fsm=False):
else:
# 输入是整个 PDF 中的信息
if is_fsm:
self.online_log.info('afc_contract_is_fsm')
f = FSMFinder(pdf_info, ocr_results=ocr_results)
else:
self.online_log.info('afc_contract_is_non_fsm')
f = Finder(pdf_info, ocr_results=ocr_results)
results = f.get_info()
return results
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!