File size: 389 Bytes
73a73f3
 
 
 
72c609a
 
287d769
73a73f3
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import pickle
import gradio as gr


with open('stress_1.0.pkl','rb') as f:
    model = pickle.load(f)
    #print(model.steps)

def predict_stress(text):
  return model.predict([text])[0].upper()


demo = gr.Interface(
    fn = predict_stress,
    inputs=gr.Textbox(lines=2, placeholder="Enter Text Here...", label = 'Predicting Stress through text'),
    outputs = 'text',
)

demo.launch()