Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
|
3 |
+
def get_sentiment_analysis(text):
|
4 |
+
classifier = pipeline("sentiment-analysis")
|
5 |
+
return classifier(text)
|
6 |
+
|
7 |
+
# Gradio code
|
8 |
+
import gradio as gr
|
9 |
+
|
10 |
+
demo = gr.Interface(fn=get_sentiment_analysis, inputs="text", outputs="text")
|
11 |
+
|
12 |
+
demo.launch()
|