Spaces:
Sleeping
Sleeping
Delete src/evaluation.py
Browse files- src/evaluation.py +0 -25
src/evaluation.py
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
from src.model import compare_candidates
|
2 |
-
|
3 |
-
def evaluate_model(openai, data):
|
4 |
-
correct_predictions = 0
|
5 |
-
|
6 |
-
for index, row in data.iterrows():
|
7 |
-
candidateA = {
|
8 |
-
'resume': row['candidateAResume'],
|
9 |
-
'transcript': row['candidateATranscript']
|
10 |
-
}
|
11 |
-
candidateB = {
|
12 |
-
'resume': row['candidateBResume'],
|
13 |
-
'transcript': row['candidateBTranscript']
|
14 |
-
}
|
15 |
-
role = row['role']
|
16 |
-
|
17 |
-
prediction = compare_candidates(openai, candidateA, candidateB, role)
|
18 |
-
|
19 |
-
if prediction:
|
20 |
-
if (prediction == 'Candidate A' and row['winnerId'] == row['candidateAId']) or \
|
21 |
-
(prediction == 'Candidate B' and row['winnerId'] == row['candidateBId']):
|
22 |
-
correct_predictions += 1
|
23 |
-
|
24 |
-
accuracy = correct_predictions / len(data)
|
25 |
-
return accuracy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|