aromal003 commited on
Commit
624dc69
·
verified ·
1 Parent(s): 05769a5

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 pipeline
3
+
4
+ sentiment_pipeline = pipeline("sentiment-analysis")
5
+ def get_sentiment(input_text):
6
+ result = get_sentiment(input_text)
7
+ return result[0].['label']
8
+
9
+ #Lauch the we ui
10
+ iface = gt.Interface(
11
+ inputs = "text",
12
+ outputs = "text",
13
+ title = "My first AI app",
14
+ description = "Enter some text and I will tell you whether it is positive or negative"
15
+ )
16
+ iface.launch()