|
@@ -1000,23 +1000,34 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
agency_contact.add(_person.entity_text)
|
|
agency_contact.add(_person.entity_text)
|
|
# 正则匹配无 '主体/联系人' 的电话
|
|
# 正则匹配无 '主体/联系人' 的电话
|
|
# 例:"采购人联系方式:0833-5226788,"
|
|
# 例:"采购人联系方式:0833-5226788,"
|
|
|
|
+ phone_pattern = '(1[3|4|5|6|7|8|9][0-9][-—-―]?\d{4}[-—-―]?\d{4}|' \
|
|
|
|
+ '\+86.?1[3|4|5|6|7|8|9]\d{9}|' \
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―][1-9]\d{6,7}/[1-9]\d{6,10}|' \
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]\d{7,8}.?转\d{1,4}|' \
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]\d{7,8}[-—-―]\d{1,4}|' \
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]?[1-9]\d{6}\d?(?=1[3|4|5|6|7|8|9]\d{9})|' \
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]?[1-9]\d{6}\d?(?=0[1-9]\d{1,2}[-—-―]?[1-9]\d{6}\d?)|' \
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]?[1-9]\d{6}\d?(?=[1-9]\d{6,7})|' \
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]?[1-9]\d{6}\d?|' \
|
|
|
|
+ '[\(|\(]0[1-9]\d{1,2}[\)|\)]-?\d{7,8}-?\d{,4}|' \
|
|
|
|
+ '[2-9]\d{6,7})'
|
|
re_tenderee_phone = re.compile(
|
|
re_tenderee_phone = re.compile(
|
|
"(?:(?:(?:采购|招标|议价|议标|比选)(?:人|公司|单位|组织|部门)|建设(?:单位|业主)|(?:采购|招标|甲)方|询价单位|项目业主|业主)[^。]{0,5}(?:电话|联系方式|联系人)[::]?[^。]{0,7}?)"
|
|
"(?:(?:(?:采购|招标|议价|议标|比选)(?:人|公司|单位|组织|部门)|建设(?:单位|业主)|(?:采购|招标|甲)方|询价单位|项目业主|业主)[^。]{0,5}(?:电话|联系方式|联系人)[::]?[^。]{0,7}?)"
|
|
# 电话号码
|
|
# 电话号码
|
|
- "(1[3-9][0-9][-—-]?\d{4}[-—-]?\d{4}|0\d{2,3}[-—-][1-9]\d{6,7}/[1-9]\d{6,7}|0\d{2,3}[-—-][1-9]\d{6,7}转\d{1,4}|0\d{2,3}[-—-]?[1-9]\d{6,7}|[\(|\(]0\d{2,3}[\)|\)]-?\d{7,8}-?\d{,4}|[1-9]\d{6,7})(?:[^\.]|$)")
|
|
|
|
|
|
+ + phone_pattern)
|
|
# 例:"采购人地址和联系方式:峨边彝族自治县教育局,0833-5226788,"
|
|
# 例:"采购人地址和联系方式:峨边彝族自治县教育局,0833-5226788,"
|
|
re_tenderee_phone2 = re.compile(
|
|
re_tenderee_phone2 = re.compile(
|
|
"(?:(?:(?:采购|招标|议价|议标|比选)(?:人|公司|单位|组织|部门)|建设(?:单位|业主)|(?:采购|招标|甲)方|询价单位|项目业主|业主)[^。]{0,3}(?:地址)[^。]{0,3}(?:电话|联系方式|联系人)[::]?[^。]{0,20}?)"
|
|
"(?:(?:(?:采购|招标|议价|议标|比选)(?:人|公司|单位|组织|部门)|建设(?:单位|业主)|(?:采购|招标|甲)方|询价单位|项目业主|业主)[^。]{0,3}(?:地址)[^。]{0,3}(?:电话|联系方式|联系人)[::]?[^。]{0,20}?)"
|
|
# 电话号码
|
|
# 电话号码
|
|
- "(1[3-9][0-9][-—-]?\d{4}[-—-]?\d{4}|0\d{2,3}[-—-][1-9]\d{6,7}/[1-9]\d{6,7}|0\d{2,3}[-—-][1-9]\d{6,7}转\d{1,4}|0\d{2,3}[-—-]?[1-9]\d{6,7}|[\(|\(]0\d{2,3}[\)|\)]-?\d{7,8}-?\d{,4}|[1-9]\d{6,7})(?:[^\.]|$)")
|
|
|
|
|
|
+ + phone_pattern)
|
|
re_agent_phone = re.compile(
|
|
re_agent_phone = re.compile(
|
|
"(?:(?:代理(?:人|机构|公司|单位|组织|方)|采购机构|集中采购机构|集采机构|招标机构)[^。]{0,5}(?:电话|联系方式|联系人)[::]?[^。]{0,7}?)"
|
|
"(?:(?:代理(?:人|机构|公司|单位|组织|方)|采购机构|集中采购机构|集采机构|招标机构)[^。]{0,5}(?:电话|联系方式|联系人)[::]?[^。]{0,7}?)"
|
|
# 电话号码
|
|
# 电话号码
|
|
- "(1[3-9][0-9][-—-]?\d{4}[-—-]?\d{4}|0\d{2,3}[-—-][1-9]\d{6,7}/[1-9]\d{6,7}|0\d{2,3}[-—-][1-9]\d{6,7}转\d{1,4}|0\d{2,3}[-—-]?[1-9]\d{6,7}|[\(|\(]0\d{2,3}[\)|\)]-?\d{7,8}-?\d{,4}|[1-9]\d{6,7})(?:[^\.]|$)")
|
|
|
|
|
|
+ + phone_pattern)
|
|
re_agent_phone2 = re.compile(
|
|
re_agent_phone2 = re.compile(
|
|
"(?:(?:代理(?:人|机构|公司|单位|组织|方)|采购机构|集中采购机构|集采机构|招标机构)[^。]{0,3}(?:地址)[^。]{0,3}(?:电话|联系方式|联系人)[::]?[^。]{0,20}?)"
|
|
"(?:(?:代理(?:人|机构|公司|单位|组织|方)|采购机构|集中采购机构|集采机构|招标机构)[^。]{0,3}(?:地址)[^。]{0,3}(?:电话|联系方式|联系人)[::]?[^。]{0,20}?)"
|
|
# 电话号码
|
|
# 电话号码
|
|
- "(1[3-9][0-9][-—-]?\d{4}[-—-]?\d{4}|0\d{2,3}[-—-][1-9]\d{6,7}/[1-9]\d{6,7}|0\d{2,3}[-—-][1-9]\d{6,7}转\d{1,4}|0\d{2,3}[-—-]?[1-9]\d{6,7}|[\(|\(]0\d{2,3}[\)|\)]-?\d{7,8}-?\d{,4}|[1-9]\d{6,7})(?:[^\.]|$)")
|
|
|
|
|
|
+ + phone_pattern)
|
|
content = ""
|
|
content = ""
|
|
for _sentence in list_sentence:
|
|
for _sentence in list_sentence:
|
|
content += "".join(_sentence.tokens)
|
|
content += "".join(_sentence.tokens)
|
|
@@ -1036,24 +1047,32 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
_tenderee_phone = re.findall(re_tenderee_phone, content)
|
|
_tenderee_phone = re.findall(re_tenderee_phone, content)
|
|
if _tenderee_phone:
|
|
if _tenderee_phone:
|
|
for _phone in _tenderee_phone:
|
|
for _phone in _tenderee_phone:
|
|
- PackDict["Project"]["roleList"][i].linklist.append(("", _phone))
|
|
|
|
- tenderee_phone.add(_phone)
|
|
|
|
|
|
+ _phone = _phone.split("/") # 分割多个号码
|
|
|
|
+ for one_phone in _phone:
|
|
|
|
+ PackDict["Project"]["roleList"][i].linklist.append(("", one_phone))
|
|
|
|
+ tenderee_phone.add(one_phone)
|
|
_tenderee_phone2 = re.findall(re_tenderee_phone2, content)
|
|
_tenderee_phone2 = re.findall(re_tenderee_phone2, content)
|
|
if _tenderee_phone2:
|
|
if _tenderee_phone2:
|
|
for _phone in _tenderee_phone2:
|
|
for _phone in _tenderee_phone2:
|
|
- PackDict["Project"]["roleList"][i].linklist.append(("", _phone))
|
|
|
|
- tenderee_phone.add(_phone)
|
|
|
|
|
|
+ _phone = _phone.split("/")
|
|
|
|
+ for one_phone in _phone:
|
|
|
|
+ PackDict["Project"]["roleList"][i].linklist.append(("", one_phone))
|
|
|
|
+ tenderee_phone.add(one_phone)
|
|
if PackDict["Project"]["roleList"][i].role_name == "agency":
|
|
if PackDict["Project"]["roleList"][i].role_name == "agency":
|
|
_agent_phone = re.findall(re_agent_phone, content)
|
|
_agent_phone = re.findall(re_agent_phone, content)
|
|
if _agent_phone:
|
|
if _agent_phone:
|
|
for _phone in _agent_phone:
|
|
for _phone in _agent_phone:
|
|
- PackDict["Project"]["roleList"][i].linklist.append(("", _phone))
|
|
|
|
- agency_phone.add(_phone)
|
|
|
|
|
|
+ _phone = _phone.split("/")
|
|
|
|
+ for one_phone in _phone:
|
|
|
|
+ PackDict["Project"]["roleList"][i].linklist.append(("", one_phone))
|
|
|
|
+ agency_phone.add(one_phone)
|
|
_agent_phone2 = re.findall(re_agent_phone2, content)
|
|
_agent_phone2 = re.findall(re_agent_phone2, content)
|
|
if _agent_phone2:
|
|
if _agent_phone2:
|
|
for _phone in _agent_phone2:
|
|
for _phone in _agent_phone2:
|
|
- PackDict["Project"]["roleList"][i].linklist.append(("", _phone))
|
|
|
|
- agency_phone.add(_phone)
|
|
|
|
|
|
+ _phone = _phone.split("/")
|
|
|
|
+ for one_phone in _phone:
|
|
|
|
+ PackDict["Project"]["roleList"][i].linklist.append(("", one_phone))
|
|
|
|
+ agency_phone.add(one_phone)
|
|
# km配对方法
|
|
# km配对方法
|
|
def dispatch(match_list):
|
|
def dispatch(match_list):
|
|
main_roles = list(set([match.main_role for match in match_list]))
|
|
main_roles = list(set([match.main_role for match in match_list]))
|
|
@@ -1077,13 +1096,14 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
key_word = re.compile('((?:电话|联系方式|联系人).{0,4}?)([0-1]\d{6,11})')
|
|
key_word = re.compile('((?:电话|联系方式|联系人).{0,4}?)([0-1]\d{6,11})')
|
|
phone = re.compile('1[3|4|5|6|7|8|9][0-9][-—-―]?\d{4}[-—-―]?\d{4}|'
|
|
phone = re.compile('1[3|4|5|6|7|8|9][0-9][-—-―]?\d{4}[-—-―]?\d{4}|'
|
|
'\+86.?1[3|4|5|6|7|8|9]\d{9}|'
|
|
'\+86.?1[3|4|5|6|7|8|9]\d{9}|'
|
|
- '0[^0]\d{1,2}[-—-―][1-9]\d{6,7}/[1-9]\d{6,10}|'
|
|
|
|
- '0[^0]\d{1,2}[-—-―]\d{7,8}转\d{1,4}|'
|
|
|
|
- '0[^0]\d{1,2}[-—-―]?[1-9]\d{6}\d?(?=1[3|4|5|6|7|8|9]\d{9})|'
|
|
|
|
- '0[^0]\d{1,2}[-—-―]?[1-9]\d{6}\d?(?=0[^0]\d{1,2}[-—-―]?[1-9]\d{6}\d?)|'
|
|
|
|
- '0[^0]\d{1,2}[-—-―]?[1-9]\d{6}\d?(?=[1-9]\d{6,7})|'
|
|
|
|
- '0[^0]\d{1,2}[-—-―]?[1-9]\d{6}\d?|'
|
|
|
|
- '[\(|\(]0[^0]\d{1,2}[\)|\)]-?\d{7,8}-?\d{,4}|'
|
|
|
|
|
|
+ # '0[^0]\d{1,2}[-—-―][1-9]\d{6,7}/[1-9]\d{6,10}|'
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]\d{7,8}.?转\d{1,4}|'
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]\d{7,8}[-—-―]\d{1,4}|'
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]?[1-9]\d{6}\d?(?=1[3|4|5|6|7|8|9]\d{9})|'
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]?[1-9]\d{6}\d?(?=0[1-9]\d{1,2}[-—-―]?[1-9]\d{6}\d?)|'
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]?[1-9]\d{6}\d?(?=[1-9]\d{6,7})|'
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]?[1-9]\d{6}\d?|'
|
|
|
|
+ '[\(|\(]0[1-9]\d{1,2}[\)|\)]-?\d{7,8}-?\d{,4}|'
|
|
'[2-9]\d{6,7}')
|
|
'[2-9]\d{6,7}')
|
|
phone_entitys = []
|
|
phone_entitys = []
|
|
for _sentence in list_sentence:
|
|
for _sentence in list_sentence:
|
|
@@ -1100,17 +1120,30 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
res_set.add((i.group(), i.start(), i.end()))
|
|
res_set.add((i.group(), i.start(), i.end()))
|
|
# for i in re.finditer(key_word, sentence_text):
|
|
# for i in re.finditer(key_word, sentence_text):
|
|
# res_set.add((i.group(2), i.start() + len(i.group(1)), i.end()))
|
|
# res_set.add((i.group(2), i.start() + len(i.group(1)), i.end()))
|
|
- for item in list(res_set):
|
|
|
|
|
|
+ res_set = sorted(list(res_set),key=lambda x:x[1])
|
|
|
|
+ last_phone_mask = True
|
|
|
|
+ for item_idx in range(len(res_set)):
|
|
|
|
+ item = res_set[item_idx]
|
|
phone_left = sentence_text[max(0, item[1] - 10):item[1]]
|
|
phone_left = sentence_text[max(0, item[1] - 10):item[1]]
|
|
phone_right = sentence_text[item[2]:item[2] + 8]
|
|
phone_right = sentence_text[item[2]:item[2] + 8]
|
|
# 排除“传真号”和其它错误项
|
|
# 排除“传真号”和其它错误项
|
|
- if re.search("传,?真|信,?箱|邮,?箱", phone_left):
|
|
|
|
|
|
+ if re.search("传,?真|信,?箱|邮,?[箱件]", phone_left):
|
|
if not re.search("电,?话", phone_left):
|
|
if not re.search("电,?话", phone_left):
|
|
|
|
+ last_phone_mask = False
|
|
continue
|
|
continue
|
|
if re.search("帐,?号|编,?号|报,?价|证,?号|价,?格|[\((]万?元[\))]", phone_left):
|
|
if re.search("帐,?号|编,?号|报,?价|证,?号|价,?格|[\((]万?元[\))]", phone_left):
|
|
|
|
+ last_phone_mask = False
|
|
continue
|
|
continue
|
|
- if re.search("[.,]\d{2,}", phone_right):
|
|
|
|
|
|
+ if re.search("^\d{0,4}[.,]\d{2,}", phone_right):
|
|
|
|
+ last_phone_mask = False
|
|
continue
|
|
continue
|
|
|
|
+ # if:上一个phone实体不符合条件
|
|
|
|
+ if not last_phone_mask:
|
|
|
|
+ item_start = item[1]
|
|
|
|
+ last_item_end = res_set[item_idx-1][2]
|
|
|
|
+ if item_start - last_item_end<=1 or re.search("^\d+$",sentence_text[last_item_end:item_start]):
|
|
|
|
+ last_phone_mask = False
|
|
|
|
+ continue
|
|
for j in range(len(list_tokenbegin)):
|
|
for j in range(len(list_tokenbegin)):
|
|
if list_tokenbegin[j] == item[1]:
|
|
if list_tokenbegin[j] == item[1]:
|
|
begin_index = j
|
|
begin_index = j
|
|
@@ -1125,6 +1158,8 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
_entity = Entity(_sentence.doc_id, None, item[0], "phone", _sentence.sentence_index, begin_index, end_index, item[1],
|
|
_entity = Entity(_sentence.doc_id, None, item[0], "phone", _sentence.sentence_index, begin_index, end_index, item[1],
|
|
item[2])
|
|
item[2])
|
|
phone_entitys.append(_entity)
|
|
phone_entitys.append(_entity)
|
|
|
|
+ last_phone_mask = True
|
|
|
|
+
|
|
def is_company(entity,text):
|
|
def is_company(entity,text):
|
|
# 判断"公司"实体是否为地址地点
|
|
# 判断"公司"实体是否为地址地点
|
|
if entity.label!=5 and entity.values[entity.label]>0.5:
|
|
if entity.label!=5 and entity.values[entity.label]>0.5:
|
|
@@ -1134,7 +1169,7 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
entity_left = text[max(0,entity.wordOffset_begin-10):entity.wordOffset_begin]
|
|
entity_left = text[max(0,entity.wordOffset_begin-10):entity.wordOffset_begin]
|
|
entity_left = re.sub(",()\(\)::","",entity_left)
|
|
entity_left = re.sub(",()\(\)::","",entity_left)
|
|
entity_left = entity_left[-5:]
|
|
entity_left = entity_left[-5:]
|
|
- if re.search("地址|地点",entity_left):
|
|
|
|
|
|
+ if re.search("地址|地点|银行[::]",entity_left):
|
|
return False
|
|
return False
|
|
else:
|
|
else:
|
|
return True
|
|
return True
|
|
@@ -1156,7 +1191,7 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
_pre_data = pre_data[start:start+maxlen]
|
|
_pre_data = pre_data[start:start+maxlen]
|
|
_text_data = text_data[start:start+maxlen]
|
|
_text_data = text_data[start:start+maxlen]
|
|
relation_list.extend(relationExtraction_model.predict(_text_data,_pre_data))
|
|
relation_list.extend(relationExtraction_model.predict(_text_data,_pre_data))
|
|
- start = start + maxlen - 100
|
|
|
|
|
|
+ start = start + maxlen - 120
|
|
# 去重结果
|
|
# 去重结果
|
|
relation_list = list(set(relation_list))
|
|
relation_list = list(set(relation_list))
|
|
# print(relation_list)
|
|
# print(relation_list)
|
|
@@ -1364,12 +1399,17 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
last_words_num = len(sentence.sentence_text)
|
|
last_words_num = len(sentence.sentence_text)
|
|
|
|
|
|
# 公司-联系人连接(km算法)
|
|
# 公司-联系人连接(km算法)
|
|
- re_phone = re.compile('1[3-9][0-9][-—-]?\d{4}[-—-]?\d{4}|'
|
|
|
|
- '0\d{2,3}[-—-][1-9]\d{6,7}/[1-9]\d{6,10}|'
|
|
|
|
- '0\d{2,3}[-—-][1-9]\d{6,7}转\d{1,4}|'
|
|
|
|
- '0\d{2,3}[-—-]?[1-9]\d{6,7}|'
|
|
|
|
- '[\(|\(]0\d{2,3}[\)|\)]-?\d{7,8}-?\d{,4}|'
|
|
|
|
- '[1-9]\d{6,7}')
|
|
|
|
|
|
+ re_phone = re.compile('1[3|4|5|6|7|8|9][0-9][-—-―]?\d{4}[-—-―]?\d{4}|'
|
|
|
|
+ '\+86.?1[3|4|5|6|7|8|9]\d{9}|'
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―][1-9]\d{6,7}/[1-9]\d{6,10}|'
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]\d{7,8}.?转\d{1,4}|'
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]\d{7,8}[-—-―]\d{1,4}|'
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]?[1-9]\d{6}\d?(?=1[3|4|5|6|7|8|9]\d{9})|'
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]?[1-9]\d{6}\d?(?=0[1-9]\d{1,2}[-—-―]?[1-9]\d{6}\d?)|'
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]?[1-9]\d{6}\d?(?=[1-9]\d{6,7})|'
|
|
|
|
+ '0[1-9]\d{1,2}[-—-―]?[1-9]\d{6}\d?|'
|
|
|
|
+ '[\(|\(]0[1-9]\d{1,2}[\)|\)]-?\d{7,8}-?\d{,4}|'
|
|
|
|
+ '[2-9]\d{6,7}')
|
|
key_phone = re.compile("联系方式|电话|联系人|负责人")
|
|
key_phone = re.compile("联系方式|电话|联系人|负责人")
|
|
temporary_list2 = []
|
|
temporary_list2 = []
|
|
for entity in list_entity:
|
|
for entity in list_entity:
|
|
@@ -1553,8 +1593,6 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
# km算法分配求解
|
|
# km算法分配求解
|
|
result2 = dispatch(match_list2)
|
|
result2 = dispatch(match_list2)
|
|
# print(result2)
|
|
# print(result2)
|
|
- linked_person = []
|
|
|
|
- linked_persons_with = []
|
|
|
|
for match in result2:
|
|
for match in result2:
|
|
entity = match[0]
|
|
entity = match[0]
|
|
# print(entity.entity_text)
|
|
# print(entity.entity_text)
|
|
@@ -1563,7 +1601,8 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
is_update = False
|
|
is_update = False
|
|
if isinstance(match[1], tuple):
|
|
if isinstance(match[1], tuple):
|
|
person_ = ''
|
|
person_ = ''
|
|
- phone_ = [match[1][1]]
|
|
|
|
|
|
+ phone_ = match[1][1].split("/") # 分割多个号码
|
|
|
|
+ # print(person_,phone_)
|
|
else:
|
|
else:
|
|
person_ = match[1].entity_text
|
|
person_ = match[1].entity_text
|
|
phone_ = [i.entity_text for i in match[1].person_phone] if match[1].person_phone else []
|
|
phone_ = [i.entity_text for i in match[1].person_phone] if match[1].person_phone else []
|
|
@@ -1576,6 +1615,7 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
if not phone_:
|
|
if not phone_:
|
|
PackDict[k]["roleList"][i].linklist.append((person_, ""))
|
|
PackDict[k]["roleList"][i].linklist.append((person_, ""))
|
|
for p in phone_:
|
|
for p in phone_:
|
|
|
|
+ # if not person_ and len()
|
|
PackDict[k]["roleList"][i].linklist.append((person_, p))
|
|
PackDict[k]["roleList"][i].linklist.append((person_, p))
|
|
is_update = True
|
|
is_update = True
|
|
elif PackDict[k]["roleList"][i].role_name == "agency":
|
|
elif PackDict[k]["roleList"][i].role_name == "agency":
|
|
@@ -1604,9 +1644,14 @@ def findAttributeAfterEntity(PackDict,roleSet,PackageList,PackageSet,list_entity
|
|
if not list_entity[entity_index].pointer_person:
|
|
if not list_entity[entity_index].pointer_person:
|
|
list_entity[entity_index].pointer_person = []
|
|
list_entity[entity_index].pointer_person = []
|
|
list_entity[entity_index].pointer_person.append(match[1])
|
|
list_entity[entity_index].pointer_person.append(match[1])
|
|
- linked_person.append(match[1])
|
|
|
|
- linked_persons_with.append(entity)
|
|
|
|
|
|
|
|
|
|
+ linked_person = []
|
|
|
|
+ linked_persons_with = []
|
|
|
|
+ for company_entity in [entity for entity in list_entity if entity.entity_type in ['company','org']]:
|
|
|
|
+ if company_entity.pointer_person:
|
|
|
|
+ for _person in company_entity.pointer_person:
|
|
|
|
+ linked_person.append(_person)
|
|
|
|
+ linked_persons_with.append(company_entity)
|
|
|
|
|
|
# 一个公司对应多个联系人的补充
|
|
# 一个公司对应多个联系人的补充
|
|
person_entitys = [entity for entity in list_entity if entity.entity_type=='person']
|
|
person_entitys = [entity for entity in list_entity if entity.entity_type=='person']
|