khadija3818 commited on
Commit
c9e7157
·
1 Parent(s): 1e8cd7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -2,8 +2,8 @@ import streamlit as st
2
  from transformers import pipeline
3
 
4
  def detect_emotion(sentence):
5
- sentiment_analyzer = pipeline("sentiment-analysis")
6
- result = sentiment_analyzer(sentence)
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