|
|
import streamlit as st |
|
|
|
|
|
import pandas as pd |
|
|
import joblib |
|
|
|
|
|
st.set_page_config(page_title="Stress Classification",layout="wide") |
|
|
|
|
|
st.markdown("<h1 style='font-size:40px;color:darkred;text-align:center'>Stress Categorization Using BERT Algorithm</h1>",unsafe_allow_html=True) |
|
|
|
|
|
|
|
|
st.markdown("<h2 style='font-size:30px;color:black;'>Enter your concern</h2>",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") |
|
|
|
|
|
|
|
|
|