afiz commited on
Commit
10ce087
·
1 Parent(s): 7431a4e

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+
3
+ def get_sentiment_analysis(text):
4
+ classifier = pipeline("sentiment-analysis")
5
+ return classifier(text)
6
+
7
+ # Gradio code
8
+ import gradio as gr
9
+
10
+ demo = gr.Interface(fn=get_sentiment_analysis, inputs="text", outputs="text")
11
+
12
+ demo.launch()