import streamlit as st
import pandas as pd
import joblib
st.set_page_config(page_title="Stress Classification",layout="wide")
st.markdown("
Stress Categorization Using BERT Algorithm
",unsafe_allow_html=True)
st.markdown("Enter your concern
",unsafe_allow_html=True)
posts = st.text_area("")
if st.button("Predict"):
vector = joblib.load("stress.h5")
predictions = vector.transform([posts])
model = joblib.load("stress_model.h5")
pred = model.predict(predictions)
if pred[0]=="Financial Stress":
st.success("This Posts suggests that person has Financial Stress.")
elif pred[0]=="Health Stress":
st.success("This Posts suggests that person has Health Stress.")
elif pred[0] == "Other Stress":
st.success("This Posts suggests that person has Other Type Of Stress.")
elif pred[0] =="Work Stress":
st.success("This Posts suggests that person has Work Stress")
# We need not use conditional statements as its in labels and we didn;t encode it