Update app.py
Browse files
app.py
CHANGED
@@ -46,7 +46,9 @@ def text_extraction(image):
|
|
46 |
|
47 |
def analyze_sentiment(text):
|
48 |
results = requests.post(EMOTIONS_API_URL, headers=headers, json=text)
|
49 |
-
|
|
|
|
|
50 |
return sentiment_results
|
51 |
|
52 |
def get_sentiment_emoji(sentiment):
|
|
|
46 |
|
47 |
def analyze_sentiment(text):
|
48 |
results = requests.post(EMOTIONS_API_URL, headers=headers, json=text)
|
49 |
+
print(results.json())
|
50 |
+
res = results.json()[0]
|
51 |
+
sentiment_results = {result['label']: result['score'] for result in res}
|
52 |
return sentiment_results
|
53 |
|
54 |
def get_sentiment_emoji(sentiment):
|