Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -60,13 +60,22 @@ if st.button("Predict Personality by Test"):
|
|
60 |
data['Predicted'] = data.apply(get_predictions, axis=1)
|
61 |
st.dataframe(data[['True_label','MAX1','MAX2','MAX3', 'Predicted']])
|
62 |
|
63 |
-
if st.button("Predict Personality by Open Question"):
|
64 |
def get_predictions(row):
|
65 |
processed_text = row['processed_text_open']
|
66 |
result = classifier(processed_text, labels)
|
67 |
highest_score_label = result['labels'][0] # Assumes the labels are sorted by score, highest first
|
68 |
return highest_score_label
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
def get_predictionsM(row):
|
71 |
processed_text = row['processed_text_mopen']
|
72 |
result = classifier(processed_text, labels)
|
@@ -75,5 +84,4 @@ if st.button("Predict Personality by Open Question"):
|
|
75 |
|
76 |
# Apply predictions across all rows
|
77 |
data_open['Predicted_M'] = data_open.apply(get_predictions, axis=1)
|
78 |
-
data_open['
|
79 |
-
st.dataframe(data_open[['True_label', 'Predicted_F', 'Predicted_M']])
|
|
|
60 |
data['Predicted'] = data.apply(get_predictions, axis=1)
|
61 |
st.dataframe(data[['True_label','MAX1','MAX2','MAX3', 'Predicted']])
|
62 |
|
63 |
+
if st.button("Predict Personality by Open Question F"):
|
64 |
def get_predictions(row):
|
65 |
processed_text = row['processed_text_open']
|
66 |
result = classifier(processed_text, labels)
|
67 |
highest_score_label = result['labels'][0] # Assumes the labels are sorted by score, highest first
|
68 |
return highest_score_label
|
69 |
|
70 |
+
|
71 |
+
|
72 |
+
# Apply predictions across all rows
|
73 |
+
data_open['Predicted_F'] = data_open.apply(get_predictionsM, axis=1)
|
74 |
+
st.dataframe(data_open[['True_label', 'Predicted_F']])
|
75 |
+
|
76 |
+
if st.button("Predict Personality by Open Question M"):
|
77 |
+
|
78 |
+
|
79 |
def get_predictionsM(row):
|
80 |
processed_text = row['processed_text_mopen']
|
81 |
result = classifier(processed_text, labels)
|
|
|
84 |
|
85 |
# Apply predictions across all rows
|
86 |
data_open['Predicted_M'] = data_open.apply(get_predictions, axis=1)
|
87 |
+
st.dataframe(data_open[['True_label', 'Predicted_M']])
|
|