Spaces:
Sleeping
Sleeping
function optimization
Browse files
app.py
CHANGED
@@ -267,48 +267,53 @@ with gr.Blocks(title="HRMaster", theme="soft") as demo:
|
|
267 |
|
268 |
jd_row = gr.Row(visible=False)
|
269 |
with jd_row:
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
fit_button.click(person_job_fit_gene, [text_output, jd],
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
6. 持续学习和研究新的技术和开发工具,提出并实施技术创新和改进。
|
295 |
-
|
296 |
-
任职要求:
|
297 |
-
1. 精通Java编程语言,熟悉Java相关的开发框架和工具,如Spring、Hibernate等。
|
298 |
-
2. 具备扎实的计算机基础知识,熟悉面向对象设计和设计模式。
|
299 |
-
3. 具备良好的数据结构和算法基础,对系统性能优化有一定的经验。
|
300 |
-
4. 熟悉Web开发相关的技术,如HTML、CSS、JavaScript等。
|
301 |
-
5. 具备良好的沟通能力和团队协作能力,能够与团队成员和其他相关岗位进行有效的沟通和合作。
|
302 |
-
6. 具备良好的问题解决能力和学习能力,能够快速地理解和解决技术问题。
|
303 |
-
7. 具备良好的代码风格和规范意识,注重代码质量和可维护性。
|
304 |
-
'''
|
305 |
-
gr.Examples([test_jd], [jd])
|
306 |
-
radar_row = gr.Row(visible=False)
|
307 |
-
with radar_row:
|
308 |
-
radar_outputs = gr.Plot(label="能力雷达图")
|
309 |
-
radar_reasons = gr.Textbox(label="打分理由")
|
310 |
-
radar_button = gr.Button(value="生成能力雷达图")
|
311 |
-
radar_button.click(gene_talent_radar, [text_output, jd], [radar_outputs, radar_reasons])
|
312 |
gr.Examples([os.path.join(os.path.dirname(__file__), "test_resume.txt")], resume_file,
|
313 |
[text_output, talent_row, jd_row, radar_row], fn=parse_file, cache_examples=True)
|
314 |
resume_file.change(parse_file, resume_file, [text_output, talent_row, jd_row, radar_row])
|
@@ -316,12 +321,10 @@ with gr.Blocks(title="HRMaster", theme="soft") as demo:
|
|
316 |
with gr.Tab("面试过程辅助"):
|
317 |
interview_row = gr.Row(visible=True)
|
318 |
with interview_row:
|
319 |
-
interview_questions_text = gr.Checkboxgroup(label="面试问题")
|
320 |
interview_questions_generator_button = gr.Button(value="面试问题生成")
|
321 |
-
copy_interview_questions_button = gr.Button(value="拷贝面试问题", visible=False)
|
322 |
interview_questions_generator_button.click(generate_interview_questions_new, [text_output, jd],
|
323 |
-
[interview_questions_text
|
324 |
-
copy_interview_questions_button])
|
325 |
|
326 |
with gr.Tab("测试数据生成"):
|
327 |
with gr.Row():
|
@@ -331,7 +334,7 @@ with gr.Blocks(title="HRMaster", theme="soft") as demo:
|
|
331 |
value=["个人信息", "教育背景", "工作经历", "技能专长", "项目经验", "自我评价"], multiselect=True, label="简历维度",
|
332 |
info="测试简历维度信息"
|
333 |
)
|
334 |
-
test_resume_text = gr.Textbox(label="生成的测试简历信息")
|
335 |
resume_gene_button = gr.Button("测试数据生成")
|
336 |
resume_gene_button.click(generate_test_resume, [targrt_job, resume_item_list], test_resume_text)
|
337 |
test_targrt_job = "java开发工程师"
|
@@ -356,13 +359,13 @@ with gr.Blocks(title="HRMaster", theme="soft") as demo:
|
|
356 |
if_ok = gr.Radio(["是", "否"], label="是否录用", info="最终结果")
|
357 |
|
358 |
with gr.Column():
|
359 |
-
interview_feedback_text = gr.Textbox(label="面试评价")
|
360 |
result_button = gr.Button(value="面试评价生成")
|
361 |
result_button.click(generate_interview_feedback,
|
362 |
inputs=[commu_skills, pro_skills, tech_skills, solve_skills, team_skills,
|
363 |
pressure_resistance, if_ok],
|
364 |
outputs=interview_feedback_text)
|
365 |
-
gr.Examples([["强", "中", "弱", "强", "中", "弱", "是"]],
|
366 |
[commu_skills, pro_skills, tech_skills, solve_skills, team_skills,
|
367 |
pressure_resistance, if_ok], interview_feedback_text,
|
368 |
fn=generate_interview_feedback,
|
@@ -375,8 +378,6 @@ with gr.Blocks(title="HRMaster", theme="soft") as demo:
|
|
375 |
txt = gr.Textbox(show_label=False, placeholder="Enter text and press enter").style(container=False)
|
376 |
txt.submit(predict, [txt, state], [chatbot, state])
|
377 |
clear.click(lambda: None, None, chatbot, queue=False)
|
378 |
-
# with gr.Accordion("Open for More!"):
|
379 |
-
# gr.Markdown("Look at me...")
|
380 |
|
381 |
-
|
382 |
-
|
|
|
267 |
|
268 |
jd_row = gr.Row(visible=False)
|
269 |
with jd_row:
|
270 |
+
with gr.Column():
|
271 |
+
jd = gr.Textbox(label="岗位JD")
|
272 |
+
test_jd = '''
|
273 |
+
职位名称:Java开发工程师
|
274 |
+
|
275 |
+
工作职责:
|
276 |
+
1. 根据业务需求,参与需求分析、系统设计和架构设计。
|
277 |
+
2. 开发和维护基于Java技术的Web应用程序、服务端组件和工具。
|
278 |
+
3. 编写高质量的可维护、可扩展的代码,并进行单元测试和代码审查。
|
279 |
+
4. 对现有系统进行优化和性能调优,确保系统的高可用性和稳定性。
|
280 |
+
5. 与产品经理、设计师和测试人员紧密合作,确保产品质量和用户体验。
|
281 |
+
6. 持续学习和研究新的技术和开发工具,提出并实施技术创新和改进。
|
282 |
+
|
283 |
+
任职要求:
|
284 |
+
1. 精通Java编程语言,熟悉Java相关的开发框架和工具,如Spring、Hibernate等。
|
285 |
+
2. 具备扎实的计算机基础知识,熟悉面向对象设计和设计模式。
|
286 |
+
3. 具备良好的数据结构和算法基础,对系统性能优化有一定的经验。
|
287 |
+
4. 熟悉Web开发相关的技术,如HTML、CSS、JavaScript等。
|
288 |
+
5. 具备良好的沟通能力和团队协作能力,能够与团队成员和其他相关岗位进行有效的沟通和合作。
|
289 |
+
6. 具备良好的问题解决能力和学习能力,能够快速地理解和解决技术问题。
|
290 |
+
7. 具备良好的代码风格和规范意识,注重代码质量和可维护性。
|
291 |
+
'''
|
292 |
+
gr.Examples([test_jd], [jd])
|
293 |
+
with gr.Column():
|
294 |
+
# person_job_fit = gr.Textbox(label="人岗匹配度")
|
295 |
+
edu_matching = gr.CheckboxGroup(["完全匹配", "较为匹配", "较不匹配", "完全不匹配"], label="教育背景匹配度", info="")
|
296 |
+
edu_description = gr.Textbox(label="评估说明",)
|
297 |
+
work_exp_matching = gr.CheckboxGroup(["完全匹配", "较为匹配", "较不匹配", "完全不匹配"], label="工作经验匹配度", info="")
|
298 |
+
work_exp_description = gr.Textbox(label="评估说明")
|
299 |
+
skill_matching = gr.CheckboxGroup(["完全匹配", "较为匹配", "较不匹配", "完全不匹配"], label="技能与能力匹配度", info="")
|
300 |
+
skill_description = gr.Textbox(label="评估说明")
|
301 |
+
other_matching = gr.CheckboxGroup(["完全匹配", "较为匹配", "较不匹配", "完全不匹配"], label="其他因素匹配度", info="")
|
302 |
+
other_description = gr.Textbox(label="评估说明")
|
303 |
+
overall_matching = gr.CheckboxGroup(["完全匹配", "较为匹配", "较不匹配", "完全不匹配"], label="整体匹配度", info="")
|
304 |
+
overall_description = gr.Textbox(label="评估说明")
|
305 |
+
fit_button = gr.Button(value="计算人岗匹配度", )
|
306 |
fit_button.click(person_job_fit_gene, [text_output, jd],
|
307 |
+
[edu_matching, work_exp_matching, skill_matching, other_matching, overall_matching,
|
308 |
+
edu_description, work_exp_description, skill_description, other_description,
|
309 |
+
overall_description])
|
310 |
+
|
311 |
+
radar_row = gr.Row(visible=False)
|
312 |
+
with radar_row:
|
313 |
+
radar_outputs = gr.Plot(label="能力雷达图")
|
314 |
+
radar_reasons = gr.Textbox(label="打分理由")
|
315 |
+
radar_button = gr.Button(value="生成能力雷达图")
|
316 |
+
radar_button.click(gene_talent_radar, [text_output, jd], [radar_outputs, radar_reasons])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
317 |
gr.Examples([os.path.join(os.path.dirname(__file__), "test_resume.txt")], resume_file,
|
318 |
[text_output, talent_row, jd_row, radar_row], fn=parse_file, cache_examples=True)
|
319 |
resume_file.change(parse_file, resume_file, [text_output, talent_row, jd_row, radar_row])
|
|
|
321 |
with gr.Tab("面试过程辅助"):
|
322 |
interview_row = gr.Row(visible=True)
|
323 |
with interview_row:
|
324 |
+
interview_questions_text = gr.Checkboxgroup(label="面试问题", show_copy_button=True)
|
325 |
interview_questions_generator_button = gr.Button(value="面试问题生成")
|
|
|
326 |
interview_questions_generator_button.click(generate_interview_questions_new, [text_output, jd],
|
327 |
+
[interview_questions_text])
|
|
|
328 |
|
329 |
with gr.Tab("测试数据生成"):
|
330 |
with gr.Row():
|
|
|
334 |
value=["个人信息", "教育背景", "工作经历", "技能专长", "项目经验", "自我评价"], multiselect=True, label="简历维度",
|
335 |
info="测试简历维度信息"
|
336 |
)
|
337 |
+
test_resume_text = gr.Textbox(label="生成的测试简历信息", show_copy_button=True)
|
338 |
resume_gene_button = gr.Button("测试数据生成")
|
339 |
resume_gene_button.click(generate_test_resume, [targrt_job, resume_item_list], test_resume_text)
|
340 |
test_targrt_job = "java开发工程师"
|
|
|
359 |
if_ok = gr.Radio(["是", "否"], label="是否录用", info="最终结果")
|
360 |
|
361 |
with gr.Column():
|
362 |
+
interview_feedback_text = gr.Textbox(label="面试评价", show_copy_button=True)
|
363 |
result_button = gr.Button(value="面试评价生成")
|
364 |
result_button.click(generate_interview_feedback,
|
365 |
inputs=[commu_skills, pro_skills, tech_skills, solve_skills, team_skills,
|
366 |
pressure_resistance, if_ok],
|
367 |
outputs=interview_feedback_text)
|
368 |
+
gr.Examples([["强", "中", "弱", "强", "中", "弱", "是"], ["弱", "中", "弱", "强", "中", "弱", "否"]],
|
369 |
[commu_skills, pro_skills, tech_skills, solve_skills, team_skills,
|
370 |
pressure_resistance, if_ok], interview_feedback_text,
|
371 |
fn=generate_interview_feedback,
|
|
|
378 |
txt = gr.Textbox(show_label=False, placeholder="Enter text and press enter").style(container=False)
|
379 |
txt.submit(predict, [txt, state], [chatbot, state])
|
380 |
clear.click(lambda: None, None, chatbot, queue=False)
|
|
|
|
|
381 |
|
382 |
+
if __name__ == "__main__":
|
383 |
+
demo.launch(debug=True)
|