Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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 = [
|