Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
sentiment = pipeline("sentiment-analysis")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
sentiment = pipeline("sentiment-analysis")
|
5 |
+
|
6 |
+
def sent(input_text):
|
7 |
+
return sentiment(input_text)
|
8 |
+
|
9 |
+
iface = gr.Interface(fn = sent,
|
10 |
+
input = 'text' ,
|
11 |
+
output = ['text'],
|
12 |
+
title = 'sentiment analysis',
|
13 |
+
description = 'this is taking the sentiment of a sentence')
|
14 |
+
iface.launch()
|