|
@@ -2830,7 +2830,7 @@ def getOtherAttributes(list_entity):
|
|
|
"product":[],
|
|
|
"total_tendereeMoney":0,
|
|
|
"total_tendereeMoneyUnit":''}
|
|
|
-
|
|
|
+ list_serviceTime = []
|
|
|
for entity in list_entity:
|
|
|
if entity.entity_type == 'bidway':
|
|
|
dict_other["bidway"] = turnBidWay(entity.entity_text)
|
|
@@ -2838,11 +2838,7 @@ def getOtherAttributes(list_entity):
|
|
|
dict_other["moneysource"] = entity.entity_text
|
|
|
elif entity.entity_type=='serviceTime':
|
|
|
if re.search("[^之]日|天|年|月|周|星期", entity.entity_text) or re.search("\d{4}[\-\./]\d{1,2}", entity.entity_text):
|
|
|
- if not entity.in_attachment:
|
|
|
- dict_other["serviceTime"] = entity.entity_text
|
|
|
- else:
|
|
|
- if not dict_other["serviceTime"]:
|
|
|
- dict_other["serviceTime"] = entity.entity_text
|
|
|
+ list_serviceTime.append(entity)
|
|
|
elif entity.entity_type=="person" and entity.label ==4:
|
|
|
dict_other["person_review"].append(entity.entity_text)
|
|
|
elif entity.entity_type=='product':
|
|
@@ -2850,6 +2846,12 @@ def getOtherAttributes(list_entity):
|
|
|
elif entity.entity_type=='money' and entity.notes=='总投资' and dict_other["total_tendereeMoney"]<float(entity.entity_text):
|
|
|
dict_other["total_tendereeMoney"] = float(entity.entity_text)
|
|
|
dict_other["total_tendereeMoneyUnit"] = entity.money_unit
|
|
|
+ if list_serviceTime:
|
|
|
+ list_serviceTime.sort(key=lambda x:x.prob,reverse=True)
|
|
|
+ max_prob = list_serviceTime[0].prob
|
|
|
+ max_prob_serviceTime = [ent for ent in list_serviceTime if ent.prob==max_prob]
|
|
|
+ max_prob_serviceTime.sort(key=lambda x:(x.sentence_index,x.begin_index))
|
|
|
+ dict_other["serviceTime"] = max_prob_serviceTime[0].entity_text
|
|
|
|
|
|
dict_other["product"] = list(set(dict_other["product"]))
|
|
|
return dict_other
|