Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -49,11 +49,15 @@ if resume_text:
|
|
49 |
highest_score_label = resume_prediction['labels'][0]
|
50 |
st.write("Predicted Personality for the given resume:", highest_score_label)
|
51 |
|
52 |
-
# Automatic prediction for each row in DataFrame
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
57 |
|
58 |
# Separate predictions for Female and Male questions
|
59 |
for index, row in data_open.iterrows():
|
|
|
49 |
highest_score_label = resume_prediction['labels'][0]
|
50 |
st.write("Predicted Personality for the given resume:", highest_score_label)
|
51 |
|
52 |
+
# Automatic prediction for each row in DataFrame using custom labels
|
53 |
+
def predict_personality(row):
|
54 |
+
custom_labels = [row['MAX1'], row['MAX2'], row['MAX3']]
|
55 |
+
processed_text = row['processed_text']
|
56 |
+
result = classifier(processed_text, custom_labels)
|
57 |
+
return result['labels'][0] # Assumes the labels are sorted by score, highest first
|
58 |
+
|
59 |
+
data['Predicted'] = data.apply(predict_personality, axis=1)
|
60 |
+
st.dataframe(data[['True_label', 'MAX1', 'MAX2', 'MAX3', 'Predicted']])
|
61 |
|
62 |
# Separate predictions for Female and Male questions
|
63 |
for index, row in data_open.iterrows():
|