Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
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 |
+
iface = gr.Interface(fn =get_sentiment,
|
7 |
+
inputs = 'text',
|
8 |
+
outputs = ['text'],
|
9 |
+
title = 'Sentiment Analysis',
|
10 |
+
description = 'Get Sentiment Negative/positive for the given input')
|
11 |
+
iface.launch(inline = False)
|