Spaces:
Runtime error
Runtime error
copy of Amrrs
Browse fileshttps://huggingface.co/spaces/Amrrs/gradio-sentiment-analyzer/blob/main/app.py
app.py
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
|
| 5 |
|
| 6 |
-
def
|
| 7 |
-
|
| 8 |
|
| 9 |
if __name__ == "__main__":
|
| 10 |
iface = gr.Interface(
|
| 11 |
-
|
| 12 |
-
|
|
|
|
| 13 |
description = 'Get Sentiment Negative/positive for the given input',
|
| 14 |
-
outputs="text"
|
| 15 |
)
|
| 16 |
-
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
sentiment = pipeline("sentiment-analysis")
|
| 5 |
|
| 6 |
+
def get_sentiment(input_text):
|
| 7 |
+
return sentiment(input_text)
|
| 8 |
|
| 9 |
if __name__ == "__main__":
|
| 10 |
iface = gr.Interface(
|
| 11 |
+
inputs = "text",
|
| 12 |
+
outputs = ['text'],
|
| 13 |
+
title = 'Sentiment Analysis',
|
| 14 |
description = 'Get Sentiment Negative/positive for the given input',
|
|
|
|
| 15 |
)
|
| 16 |
+
iface.launch(inline = False)
|