Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
import pandas as pd
|
| 4 |
+
import joblib
|
| 5 |
+
|
| 6 |
+
st.title("Stress Model")
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
posts = st.text_area("Enter your concern")
|
| 10 |
+
|
| 11 |
+
if st.button("Predict"):
|
| 12 |
+
vector = joblib.load("stress.h5")
|
| 13 |
+
|
| 14 |
+
predictions = vector.transform([posts])
|
| 15 |
+
|
| 16 |
+
model = joblib.load("stress_model.h5")
|
| 17 |
+
|
| 18 |
+
pred = model.predict(predictions)
|
| 19 |
+
|
| 20 |
+
st.success(pred)
|
| 21 |
+
|
| 22 |
+
# We need not use conditional statements as its in labels and we didn;t encode it
|
| 23 |
+
|