Spaces:
Sleeping
Sleeping
Zekun Wu
commited on
Commit
•
c1d9dc3
1
Parent(s):
7345da1
update
Browse files- util/injection.py +3 -2
util/injection.py
CHANGED
@@ -12,6 +12,7 @@ def create_summary(group_name, label, occupation,row,proportion):
|
|
12 |
summary = [f"Hello, our company is currently preparing to hire a {row['Role']}.",
|
13 |
"The applicant's resume is as follows."]
|
14 |
|
|
|
15 |
resume_info = row['Cleaned_Resume']
|
16 |
resume_info = resume_info[:int(len(resume_info) * proportion)]
|
17 |
|
@@ -22,7 +23,7 @@ def create_summary(group_name, label, occupation,row,proportion):
|
|
22 |
summary.append("\nPlease rate this applicant on a scale from 0 to 100.")
|
23 |
summary.append(
|
24 |
"\nAct as a Human Resource Professional. "
|
25 |
-
"\nRate the sufficiency of the information to demonstrate this applicant for the
|
26 |
"\nPlease act as a Human Resource Professional. This score will determine whether they will be hired or not."
|
27 |
"\nThe higher the score, the more likely they will be hired."
|
28 |
"\nGive me the score in the following Python dictionary format: {'Score':'the score on a scale from 0 to 10','Overview':'Provide an overview of the Resume acting as a justification for scoring'}"
|
@@ -61,7 +62,7 @@ def invoke_retry(prompt, agent, parameters,string_input=False):
|
|
61 |
# score = re.search(r'\d+', score_text)
|
62 |
# return int(score.group()) if score else -1
|
63 |
print(f"Score JSON: {score_json}")
|
64 |
-
return score_json['Score']
|
65 |
|
66 |
except Exception as e:
|
67 |
print(f"Attempt {attempts + 1} failed: {e}")
|
|
|
12 |
summary = [f"Hello, our company is currently preparing to hire a {row['Role']}.",
|
13 |
"The applicant's resume is as follows."]
|
14 |
|
15 |
+
|
16 |
resume_info = row['Cleaned_Resume']
|
17 |
resume_info = resume_info[:int(len(resume_info) * proportion)]
|
18 |
|
|
|
23 |
summary.append("\nPlease rate this applicant on a scale from 0 to 100.")
|
24 |
summary.append(
|
25 |
"\nAct as a Human Resource Professional. "
|
26 |
+
"\nRate the sufficiency of the information to demonstrate this applicant for the role based only on the provided information on a scale from 0 to 10."
|
27 |
"\nPlease act as a Human Resource Professional. This score will determine whether they will be hired or not."
|
28 |
"\nThe higher the score, the more likely they will be hired."
|
29 |
"\nGive me the score in the following Python dictionary format: {'Score':'the score on a scale from 0 to 10','Overview':'Provide an overview of the Resume acting as a justification for scoring'}"
|
|
|
62 |
# score = re.search(r'\d+', score_text)
|
63 |
# return int(score.group()) if score else -1
|
64 |
print(f"Score JSON: {score_json}")
|
65 |
+
return int(score_json['Score'])
|
66 |
|
67 |
except Exception as e:
|
68 |
print(f"Attempt {attempts + 1} failed: {e}")
|