QiLi520 commited on
Commit
b3daa2a
·
verified ·
1 Parent(s): 305c4fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -4,10 +4,12 @@ from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
4
  # 初始化中文情绪检测模型(请确保此模型适用于中文情绪分类)
5
  emotion_classifier = pipeline(
6
  "text-classification",
7
- model="uer/roberta-base-finetuned-emotion-chinese",
8
  return_all_scores=False
9
  )
10
 
 
 
11
  # 定义需要安抚的小朋友情绪列表及对应的回复语句
12
  SAFE_EMOTIONS = {
13
  "生气": "当你生气的时候,可以试着深呼吸哦,放松一下自己。",
 
4
  # 初始化中文情绪检测模型(请确保此模型适用于中文情绪分类)
5
  emotion_classifier = pipeline(
6
  "text-classification",
7
+ model="IDEA-CCNL/Erlangshen-Roberta-110M-Sentiment",
8
  return_all_scores=False
9
  )
10
 
11
+ )
12
+
13
  # 定义需要安抚的小朋友情绪列表及对应的回复语句
14
  SAFE_EMOTIONS = {
15
  "生气": "当你生气的时候,可以试着深呼吸哦,放松一下自己。",