Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,10 @@ sentiment_analyzer = pipeline('sentiment-analysis')
|
|
| 6 |
|
| 7 |
# Define the function for sentiment analysis
|
| 8 |
def analyze_sentiment(text):
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
# Set up the Gradio interface
|
| 12 |
interface = gr.Interface(fn=analyze_sentiment, inputs="text", outputs="json")
|
|
|
|
| 6 |
|
| 7 |
# Define the function for sentiment analysis
|
| 8 |
def analyze_sentiment(text):
|
| 9 |
+
# Test the result here first before returning
|
| 10 |
+
result = sentiment_analyzer(text)
|
| 11 |
+
print(result) # Check the output format in the terminal
|
| 12 |
+
return result
|
| 13 |
|
| 14 |
# Set up the Gradio interface
|
| 15 |
interface = gr.Interface(fn=analyze_sentiment, inputs="text", outputs="json")
|