shashankheg commited on
Commit
fab162a
·
verified ·
1 Parent(s): 110df09

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import transformers
3
+ from transformers import pipeline
4
+
5
+
6
+ sentiment = pipeline("sentiment-analysis")
7
+
8
+ def get_sentiment(input_text):
9
+ return sentiment(input_text)
10
+ interface = gr.Interface(fn =get_sentiment,
11
+ inputs = 'text',
12
+ outputs = ['text'],
13
+ title= 'Sentiment Analysis',
14
+ theme = gr.themes.Glass(),
15
+ css = """"
16
+ body {background-color: #FFCCCB}"""
17
+ )
18
+ interface.launch()