e5f36af5 by 周伟奇

Merge branch 'feature/fsm-contract' into fix/report_ca

2 parents d7847808 dd49a253
...@@ -2360,17 +2360,24 @@ ECONTRACT_KEYWORDS_MAP = { ...@@ -2360,17 +2360,24 @@ ECONTRACT_KEYWORDS_MAP = {
2360 ('抵押贷款合同', CONTRACT_CLASSIFY), 2360 ('抵押贷款合同', CONTRACT_CLASSIFY),
2361 ('送达地址确认书', CONTRACT_QRS_CLASSIFY), 2361 ('送达地址确认书', CONTRACT_QRS_CLASSIFY),
2362 ('抵押登记豁免函', HMH_CLASSIFY), 2362 ('抵押登记豁免函', HMH_CLASSIFY),
2363 ('延长保修', FSM_CONTRACT_WEP_CLASSIFY),
2364 ('长悦保养', FSM_CONTRACT_MSI_CLASSIFY),
2365 ('汽车销售合同', FSM_CONTRACT_SC_CLASSIFY),
2366 ], 2363 ],
2367 HIL_PREFIX: [ 2364 HIL_PREFIX: [
2368 ('售后回租合同', HIL_CONTRACT_1_CLASSIFY), 2365 ('售后回租合同', HIL_CONTRACT_1_CLASSIFY),
2369 ('租赁抵押合同', HIL_CONTRACT_2_CLASSIFY), 2366 ('租赁抵押合同', HIL_CONTRACT_2_CLASSIFY),
2370 ('车辆处置协议', HIL_CONTRACT_3_CLASSIFY), 2367 ('车辆处置协议', HIL_CONTRACT_3_CLASSIFY),
2371 ('抵押登记豁免函', HMH_CLASSIFY), 2368 ('抵押登记豁免函', HMH_CLASSIFY),
2372 ('延长保修', FSM_CONTRACT_WEP_CLASSIFY), 2369 ]
2373 ('长悦保养', FSM_CONTRACT_MSI_CLASSIFY), 2370 }
2371
2372 FSM_ECONTRACT_KEYWORDS_MAP = {
2373 AFC_PREFIX: [
2374 ('延长保修条款与条件', FSM_CONTRACT_WEP_CLASSIFY),
2375 ('长悦保养套餐服务合同', FSM_CONTRACT_MSI_CLASSIFY),
2376 ('汽车销售合同', FSM_CONTRACT_SC_CLASSIFY),
2377 ],
2378 HIL_PREFIX: [
2379 ('延长保修条款与条件', FSM_CONTRACT_WEP_CLASSIFY),
2380 ('长悦保养套餐服务合同', FSM_CONTRACT_MSI_CLASSIFY),
2374 ('汽车销售合同', FSM_CONTRACT_SC_CLASSIFY), 2381 ('汽车销售合同', FSM_CONTRACT_SC_CLASSIFY),
2375 ] 2382 ]
2376 } 2383 }
......
...@@ -608,7 +608,15 @@ class UploadDocView(GenericView, DocHandler): ...@@ -608,7 +608,15 @@ class UploadDocView(GenericView, DocHandler):
608 if keyword in document_name: 608 if keyword in document_name:
609 classify_1 = classify_1_tmp 609 classify_1 = classify_1_tmp
610 break 610 break
611 elif document_name.endswith('.zip') or document_name.endswith('.rar') or document_name.endswith('.ZIP') \ 611 # FSM合同:WEP/MSI/SC
612 elif data_source == consts.DATA_SOURCE_LIST[0] and document_scheme == consts.DOC_SCHEME_LIST[0]:
613 for keyword, classify_1_tmp in consts.FSM_ECONTRACT_KEYWORDS_MAP.get(prefix):
614 if keyword in document_name:
615 classify_1 = classify_1_tmp
616 break
617
618
619 if document_name.endswith('.zip') or document_name.endswith('.rar') or document_name.endswith('.ZIP') \
612 or document_name.endswith('.RAR'): 620 or document_name.endswith('.RAR'):
613 is_zip = True 621 is_zip = True
614 622
......
...@@ -21,8 +21,7 @@ class HMHRetriever: ...@@ -21,8 +21,7 @@ class HMHRetriever:
21 for bbox, text in pdf_text_list.pop(str(0), []): 21 for bbox, text in pdf_text_list.pop(str(0), []):
22 # print(text) 22 # print(text)
23 if not is_find_name_id_company: 23 if not is_find_name_id_company:
24 # name_id_company_list = re.findall(r'借款人\(姓名(.*)证件号码(.*)与(.*公司)', text) 24 name_id_company_list = re.findall(r'姓名(.*)证件号码(.*)与(.*公司)', text)
25 name_id_company_list = re.findall(r'承租人\(姓名(.*)证件号码(.*)与(.*公司)', text)
26 for name_id_company_tuple in name_id_company_list: 25 for name_id_company_tuple in name_id_company_list:
27 if len(name_id_company_tuple) == 3: 26 if len(name_id_company_tuple) == 3:
28 result[self.search_fields_list[0][0]] = { 27 result[self.search_fields_list[0][0]] = {
...@@ -30,26 +29,7 @@ class HMHRetriever: ...@@ -30,26 +29,7 @@ class HMHRetriever:
30 self.position_str: bbox 29 self.position_str: bbox
31 } 30 }
32 result[self.search_fields_list[1][0]] = { 31 result[self.search_fields_list[1][0]] = {
33 self.words_str: name_id_company_tuple[1].replace('\u3000', '').strip(), 32 self.words_str: name_id_company_tuple[1].replace('\u3000', '').replace(')', '').replace(')', '').strip(),
34 self.position_str: bbox
35 }
36 result[self.search_fields_list[2][0]] = {
37 self.words_str: name_id_company_tuple[2],
38 self.position_str: bbox
39 }
40 is_find_name_id_company = True
41 break
42 if not is_find_name_id_company:
43 name_id_company_list = re.findall(r'借款人\(姓名(.*)证件号码(.*)与(.*公司)', text)
44 # name_id_company_list = re.findall(r'承租人\(姓名(.*)证件号码(.*)与(.*公司)', text)
45 for name_id_company_tuple in name_id_company_list:
46 if len(name_id_company_tuple) == 3:
47 result[self.search_fields_list[0][0]] = {
48 self.words_str: name_id_company_tuple[0].replace('\u3000', '').strip(),
49 self.position_str: bbox
50 }
51 result[self.search_fields_list[1][0]] = {
52 self.words_str: name_id_company_tuple[1].replace('\u3000', '').strip(),
53 self.position_str: bbox 33 self.position_str: bbox
54 } 34 }
55 result[self.search_fields_list[2][0]] = { 35 result[self.search_fields_list[2][0]] = {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!