ntam0001 commited on
Commit
04764c3
1 Parent(s): 0902382

Create app.py

Browse files

Sentiment Analysis Application

Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+ sentiment = pipeline('sentiment-analysis')
4
+ def get_sentiment(input_text):
5
+ return sentiment(input_text)
6
+ result = get_sentiment('The movie was very bad')
7
+ result
8
+
9
+ iface = gr.Interface(fn = get_sentiment,inputs="text",
10
+ outputs=['text'],
11
+ title='Sentiment Analysis',
12
+ description='Get Sentiment Analysis')
13
+ iface.launch(inline = False) #Launch app separate from one in Google Col