SteevAbrahamThomas commited on
Commit
73ad234
·
verified ·
1 Parent(s): b45b8d3

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ sentiment_pipeline=pipeline('sentiment-analysis')
5
+
6
+ def get_sentiment(input_text):
7
+ result=sentiment_pipeline(input_text)
8
+ return result[0]['label']
9
+
10
+ #Launch the web UI
11
+ iface= gr.Interface(
12
+ fn=get_sentiment,
13
+ inputs='text',
14
+ outputs='text',
15
+ title='My first AI app',
16
+ description='Enter Some Text'
17
+ )
18
+
19
+ iface.launch()