File size: 1,126 Bytes
8e8cc51
 
 
 
 
c5789a1
 
36b30f2
8e8cc51
 
0473796
3c10af4
8e8cc51
 
 
 
 
 
 
 
 
 
038cd3f
 
 
 
 
 
 
 
8e8cc51
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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")

# We need not use conditional statements as its in labels and we didn;t encode it