ipvikas commited on
Commit
29c5c8f
1 Parent(s): 980f2b0

Create app.py

Browse files

New file added

Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ classifier = pipeline('sentiment-analysis')
5
+ # classifier('We are very happy to show you the 🤗 Transformers library.')
6
+
7
+ def get_sentiment(input_text):
8
+ return classifier(input_text)
9
+
10
+ iface = gr.Interface(fn=get_sentiment,
11
+ inputs = 'text',
12
+ outputs=['text'],
13
+ title = 'ALL NLP Tasks',
14
+ description = 'Get all NLP tasks')
15
+
16
+ iface.launch(inline = False)