ntam0001 commited on
Commit
b7ba8b4
·
1 Parent(s): d9936e1

Create app.py

Browse files

Sentiment Analysis

Files changed (1) hide show
  1. app.py +10 -0
app.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
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
+ iface = gr.Interface(fn = get_sentiment,inputs="text",
9
+ outputs=['text'], title='Sentiment Analysis',description='Get Sentiment Analysis')
10
+ iface.launch(inline=False)