Mbegali commited on
Commit
17e67db
·
1 Parent(s): 8f0b22d

Create app.py

Browse files
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 pipelines
3
+
4
+ sentiment = pipeline("sentiment-analysis")
5
+ def get_sentiment(input_text):
6
+ return sentiment (input_text)
7
+
8
+ result = get_sentiment(" the movie was very bad")
9
+
10
+ result
11
+
12
+ [{'label': 'NEGATIVE', 'score': 0.9997990727424622}]
13
+
14
+ iface = gr.Interface(fn = get_sentiment, inputs = 'text', outputs = ['text'],title = 'Sentiment Analysis')
15
+
16
+ iface.launch()