新增字段1

This commit is contained in:
Àî×ÚÕñ 2022-08-26 10:08:42 +08:00
parent 232c7e850d
commit d3fff825de

View File

@ -118,6 +118,7 @@ def chkworlkandtime(listdata):
'duty': duty
}
ress.append(str(date))
return ress
@ -337,7 +338,7 @@ def get_date(schema, dates, schema_dict):
work_exp = date['work_exp']
if not work_exp:
date['work_exp'] = 0
work_exp = 0
# 工作经验float转化
if work_exp and isinstance(work_exp, str):
true_work_exp = re.search(r"\d+\.?\d*", work_exp)
@ -345,7 +346,8 @@ def get_date(schema, dates, schema_dict):
work_exp = 0
else:
work_exp = float(true_work_exp.group())
if work_exp <= 0:
date['work_exp'] = 0
if 1 <= work_exp < 3:
date['work_exp'] = 1
if 3 <= work_exp < 5:
@ -576,7 +578,6 @@ def fmtList(txtlist, dates):
if ischk:
continue
# 取出工作经验里面的公司名和时间
work_list = []
if len(work) > 0:
works = ''
for i in work:
@ -585,10 +586,11 @@ def fmtList(txtlist, dates):
ie = Taskflow('information_extraction', schema=schema)
text_lists = ie(works)
work_list = chkworlkandtime(text_lists)
if not work_list:
work_list = ["{'company_name ': '测试公司','position_name': '测试职位','duty': '测试职责'}"]
else:
work_list = ["{'company_name ': '','position_name': '','duty': ''}"]
work_list = ["{'company_name ': '测试公司','position_name': '测试职位','duty': '测试职责'}"]
# 取出获奖经历里面的公司名和时间
remembrance_list = []
if len(remembrance) > 0:
remembrances = ''
for i in remembrance:
@ -597,10 +599,11 @@ def fmtList(txtlist, dates):
ie = Taskflow('information_extraction', schema=schema)
text_lists = ie(remembrances)
remembrance_list = chkworlkandtime2(text_lists)
if not remembrance_list:
remembrance_list = ["{'prize_name ': '测试奖项', 'prize_time': '2022-08-26'}"]
else:
remembrance_list = ["{'prize_name ': '', 'prize_time': '', }"]
remembrance_list = ["{'prize_name ': '测试奖项', 'prize_time': '2022-08-26'}"]
# 取出语言能力里面的语言,掌握程度,听说,读写
language_list = []
if len(language) > 0:
works = ''
for i in work:
@ -609,8 +612,10 @@ def fmtList(txtlist, dates):
ie = Taskflow('information_extraction', schema=schema)
text_lists = ie(works)
language_list = chkworlkandtime1(text_lists)
if not language_list:
language_list = ["{'language_name ': '测试语言', 'has_sleep ': '', 'reading': '听说', 'writing': '读写'}"]
else:
language_list = ["{'language_name ': '', 'has_sleep ': '', 'reading': '', 'writing': ''}"]
language_list = ["{'language_name ': '测试语言', 'has_sleep ': '', 'reading': '听说', 'writing': '读写'}"]
# review自我评价, project项目经验work工作经验work具体工作的公司和时间upgrade教育经历specialty技能特长
dates.update({
'review': review,