Create app.py
Browse filesSentiment Analysis
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)
|