Spaces:
Runtime error
Runtime error
m00913563 commited on
Commit ·
46e6475
1
Parent(s): 056aae4
fix evaluation, separation
Browse files- evaluator.py +3 -3
- extractor_helper.py +7 -3
evaluator.py
CHANGED
|
@@ -107,7 +107,7 @@ def gpt_evaluator(payload, fewshot, response_format):
|
|
| 107 |
{"role": "system", "content": fewshot},
|
| 108 |
{"role": "user", "content": str(payload)},
|
| 109 |
],
|
| 110 |
-
response_format=
|
| 111 |
json_str = response.choices[0].message.parsed
|
| 112 |
return json_str
|
| 113 |
|
|
@@ -133,7 +133,7 @@ def evaluate_interview(competences: list[str], transcript: list):
|
|
| 133 |
# global tags
|
| 134 |
model_inputs = []
|
| 135 |
|
| 136 |
-
responses = extract_competences_and_responses(
|
| 137 |
|
| 138 |
print(len(competences))
|
| 139 |
print(len(responses))
|
|
@@ -199,7 +199,7 @@ def evaluate_interview(competences: list[str], transcript: list):
|
|
| 199 |
## output:
|
| 200 |
final_score = 0
|
| 201 |
behavioral_scores = generate_behavioral_score(result.value)
|
| 202 |
-
technical_scores = generate_technical_score(
|
| 203 |
|
| 204 |
final_score = aggregate_scores(behavioral_scores, technical_scores)
|
| 205 |
|
|
|
|
| 107 |
{"role": "system", "content": fewshot},
|
| 108 |
{"role": "user", "content": str(payload)},
|
| 109 |
],
|
| 110 |
+
response_format=response_format)
|
| 111 |
json_str = response.choices[0].message.parsed
|
| 112 |
return json_str
|
| 113 |
|
|
|
|
| 133 |
# global tags
|
| 134 |
model_inputs = []
|
| 135 |
|
| 136 |
+
responses = extract_competences_and_responses(transcripts["comp_beha"], transcript["behavioral"])
|
| 137 |
|
| 138 |
print(len(competences))
|
| 139 |
print(len(responses))
|
|
|
|
| 199 |
## output:
|
| 200 |
final_score = 0
|
| 201 |
behavioral_scores = generate_behavioral_score(result.value)
|
| 202 |
+
technical_scores = generate_technical_score(transcript["comp_tech"], transcript["technical"])
|
| 203 |
|
| 204 |
final_score = aggregate_scores(behavioral_scores, technical_scores)
|
| 205 |
|
extractor_helper.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
|
| 2 |
def extract_technical(competences: list[str], transcripts: list[dict]):
|
| 3 |
new_transcripts = {
|
|
|
|
|
|
|
| 4 |
"behavioral": [],
|
| 5 |
"technical": [],
|
| 6 |
}
|
|
@@ -14,11 +16,13 @@ def extract_technical(competences: list[str], transcripts: list[dict]):
|
|
| 14 |
# logger.info(transcript)
|
| 15 |
|
| 16 |
if transcript[0]["question"].startswith("TECHNICAL:"):
|
| 17 |
-
new_transcripts["behavioral"].append(transcript[
|
|
|
|
| 18 |
new_transcripts["technical"].append([transcript[-1]])
|
| 19 |
else:
|
| 20 |
-
new_transcripts["
|
| 21 |
-
new_transcripts["
|
|
|
|
| 22 |
|
| 23 |
return new_transcripts
|
| 24 |
|
|
|
|
| 1 |
|
| 2 |
def extract_technical(competences: list[str], transcripts: list[dict]):
|
| 3 |
new_transcripts = {
|
| 4 |
+
"comp_tech": [],
|
| 5 |
+
"comp_beha": [],
|
| 6 |
"behavioral": [],
|
| 7 |
"technical": [],
|
| 8 |
}
|
|
|
|
| 16 |
# logger.info(transcript)
|
| 17 |
|
| 18 |
if transcript[0]["question"].startswith("TECHNICAL:"):
|
| 19 |
+
# new_transcripts["behavioral"].append(transcript[0])
|
| 20 |
+
new_transcripts["comp_tech"].append(competences[i])
|
| 21 |
new_transcripts["technical"].append([transcript[-1]])
|
| 22 |
else:
|
| 23 |
+
new_transcripts["comp_beha"].append(competences[i])
|
| 24 |
+
new_transcripts["behavioral"].append(transcript[1:])
|
| 25 |
+
# new_transcripts["technical"].append([])
|
| 26 |
|
| 27 |
return new_transcripts
|
| 28 |
|