abhicodes commited on
Commit
8bea39a
1 Parent(s): 149e767

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
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
- sentiment_results = {result['label']: result['score'] for result in results.json()[0]}
 
 
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):