Spaces:
Sleeping
Sleeping
Commit ·
c9e7157
1
Parent(s): 1e8cd7c
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,8 +2,8 @@ import streamlit as st
|
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
def detect_emotion(sentence):
|
| 5 |
-
|
| 6 |
-
result =
|
| 7 |
emotion = result[0]['label']
|
| 8 |
return emotion
|
| 9 |
|
|
|
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
def detect_emotion(sentence):
|
| 5 |
+
emotion_analyzer = pipeline("text-classification", model="textattack/emotion-roberta-base")
|
| 6 |
+
result = emotion_analyzer(sentence)
|
| 7 |
emotion = result[0]['label']
|
| 8 |
return emotion
|
| 9 |
|