viswanani commited on
Commit
2e6f78c
·
verified ·
1 Parent(s): b27dfbc

Create src/app.py

Browse files
Files changed (1) hide show
  1. src/app.py +9 -0
src/app.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ clf = pipeline("sentiment-analysis", model="./outputs")
5
+
6
+ def classify(text):
7
+ return clf(text)[0]['label']
8
+
9
+ gr.Interface(fn=classify, inputs="text", outputs="text", title="Sentiment Classifier").launch()