Spaces:
Sleeping
Sleeping
jvroo
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,7 +28,7 @@ def local_sentiment_analysis(review):
|
|
| 28 |
def remote_sentiment_analysis(review):
|
| 29 |
try:
|
| 30 |
# Make a request to the Hugging Face Inference API for text classification
|
| 31 |
-
response = inference_client.text_classification(
|
| 32 |
sentiment = response[0]['label']
|
| 33 |
score = response[0]['score']
|
| 34 |
return f"Sentiment: {sentiment}, Confidence: {score:.2f}"
|
|
|
|
| 28 |
def remote_sentiment_analysis(review):
|
| 29 |
try:
|
| 30 |
# Make a request to the Hugging Face Inference API for text classification
|
| 31 |
+
response = inference_client.text_classification(review)
|
| 32 |
sentiment = response[0]['label']
|
| 33 |
score = response[0]['score']
|
| 34 |
return f"Sentiment: {sentiment}, Confidence: {score:.2f}"
|