Merge branch 'feature/CHINARPA-4495'
Showing
2 changed files
with
2 additions
and
4 deletions
... | @@ -1507,7 +1507,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -1507,7 +1507,7 @@ class Command(BaseCommand, LoggerMixin): |
1507 | # AFC合同 | 1507 | # AFC合同 |
1508 | if classify_1_str == str(consts.CONTRACT_CLASSIFY): | 1508 | if classify_1_str == str(consts.CONTRACT_CLASSIFY): |
1509 | is_fsm = doc.is_ovp_fsm == 1 | 1509 | is_fsm = doc.is_ovp_fsm == 1 |
1510 | ocr_result = afc_predict(self,pdf_handler.pdf_info, is_fsm=is_fsm) | 1510 | ocr_result = afc_predict(pdf_handler.pdf_info, is_fsm=is_fsm) |
1511 | page_res = {} | 1511 | page_res = {} |
1512 | for page_num, page_info in ocr_result.get('page_info', {}).items(): | 1512 | for page_num, page_info in ocr_result.get('page_info', {}).items(): |
1513 | if isinstance(page_num, str) and page_num.startswith('page_'): | 1513 | if isinstance(page_num, str) and page_num.startswith('page_'): | ... | ... |
... | @@ -24,7 +24,7 @@ def extract_info(ocr_results): | ... | @@ -24,7 +24,7 @@ def extract_info(ocr_results): |
24 | return {'page_1': {'合同编号': contract_no}} | 24 | return {'page_1': {'合同编号': contract_no}} |
25 | 25 | ||
26 | 26 | ||
27 | def predict(self, pdf_info, is_qrs=False, is_fsm=False): | 27 | def predict(pdf_info, is_qrs=False, is_fsm=False): |
28 | pop_seceond_page_info = {} | 28 | pop_seceond_page_info = {} |
29 | if not is_fsm and not is_qrs and len(pdf_info) == 9: | 29 | if not is_fsm and not is_qrs and len(pdf_info) == 9: |
30 | pop_seceond_page_info = pdf_info.pop('1', {}) | 30 | pop_seceond_page_info = pdf_info.pop('1', {}) |
... | @@ -61,10 +61,8 @@ def predict(self, pdf_info, is_qrs=False, is_fsm=False): | ... | @@ -61,10 +61,8 @@ def predict(self, pdf_info, is_qrs=False, is_fsm=False): |
61 | else: | 61 | else: |
62 | # 输入是整个 PDF 中的信息 | 62 | # 输入是整个 PDF 中的信息 |
63 | if is_fsm: | 63 | if is_fsm: |
64 | self.online_log.info('afc_contract_is_fsm') | ||
65 | f = FSMFinder(pdf_info, ocr_results=ocr_results) | 64 | f = FSMFinder(pdf_info, ocr_results=ocr_results) |
66 | else: | 65 | else: |
67 | self.online_log.info('afc_contract_is_non_fsm') | ||
68 | f = Finder(pdf_info, ocr_results=ocr_results) | 66 | f = Finder(pdf_info, ocr_results=ocr_results) |
69 | results = f.get_info() | 67 | results = f.get_info() |
70 | return results | 68 | return results | ... | ... |
-
Please register or sign in to post a comment