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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -45,10 +45,9 @@ def text_extraction(image):
45
  return image, text_content, facial_data
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):
 
45
  return image, text_content, facial_data
46
 
47
  def analyze_sentiment(text):
48
+ results = sentiment_analysis(text)
49
+ print(results)
50
+ sentiment_results = {result['label']: result['score'] for result in results}
 
51
  return sentiment_results
52
 
53
  def get_sentiment_emoji(sentiment):