Update app.py
Browse files
app.py
CHANGED
@@ -69,14 +69,14 @@ def main():
|
|
69 |
# Make prediction
|
70 |
response = model.predict(processed_text)
|
71 |
predicted_class = response.argmax(axis=-1)[0]
|
72 |
-
# Map the predicted class index to the corresponding label
|
73 |
-
st.write("Predicted Index:", predicted_class)
|
74 |
-
st.write("Predicted Mental State:", predicted_label)
|
75 |
|
|
|
76 |
predicted_label = class_labels.get(predicted_class, "Unknown")
|
77 |
-
|
78 |
-
# Display the
|
|
|
79 |
st.write("Predicted Mental State:", predicted_label)
|
80 |
|
|
|
81 |
if __name__ == "__main__":
|
82 |
main()
|
|
|
69 |
# Make prediction
|
70 |
response = model.predict(processed_text)
|
71 |
predicted_class = response.argmax(axis=-1)[0]
|
|
|
|
|
|
|
72 |
|
73 |
+
# Ensure the predicted_label is always assigned
|
74 |
predicted_label = class_labels.get(predicted_class, "Unknown")
|
75 |
+
|
76 |
+
# Display the predicted index and label
|
77 |
+
st.write("Predicted Index:", predicted_class)
|
78 |
st.write("Predicted Mental State:", predicted_label)
|
79 |
|
80 |
+
|
81 |
if __name__ == "__main__":
|
82 |
main()
|