SamanthaStorm commited on
Commit
b1186b8
·
verified ·
1 Parent(s): f81397d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -141,6 +141,8 @@ DARVO_MOTIFS = [
141
  ]
142
  def get_emotion_profile(text):
143
  emotions = emotion_pipeline(text)
 
 
144
  return {e['label'].lower(): round(e['score'], 3) for e in emotions}
145
  def detect_contradiction(message):
146
  patterns = [
 
141
  ]
142
  def get_emotion_profile(text):
143
  emotions = emotion_pipeline(text)
144
+ if isinstance(emotions, list) and isinstance(emotions[0], list):
145
+ emotions = emotions[0] # unwrap nested list
146
  return {e['label'].lower(): round(e['score'], 3) for e in emotions}
147
  def detect_contradiction(message):
148
  patterns = [