Karthix1 commited on
Commit
535a668
·
verified ·
1 Parent(s): 8d478df

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ def prediction(text):
3
+ text_processed=(preprocess_nltk(text))
4
+ ans=pipe2.predict([text_processed])
5
+ classes = ['Irrelevant', 'Natural', 'Negative', 'Positive']
6
+ predicted_label = ans[0]
7
+ return(f"The above text is:{classes[predicted_label]}" )
8
+
9
+ pre = gr.Interface(
10
+ fn=prediction,
11
+ inputs=["text"],
12
+ outputs=[gr.Textbox(label="Prediction", lines=3)],
13
+ )
14
+
15
+ pre.launch()