3535class EmotionSkillScenario :
3636 def __init__ (self , steps , jokes , advices , logger ):
3737 self .emotion_precision = {
38- "anger" : 0.9 ,
39- "fear" : 0.894 ,
40- "joy" : 1 ,
41- "love" : 0.778 ,
42- "sadness" : 1 ,
43- "surprise" : 0.745 ,
38+ "anger" : 0.6 ,
39+ "fear" : 0.8 ,
40+ "joy" : 0.8 ,
41+ "love" : 0.8 ,
42+ "sadness" : 0.8 ,
43+ "surprise" : 0.7 ,
4444 "neutral" : 0 ,
4545 }
4646 self .steps = steps
@@ -128,7 +128,7 @@ def _get_reply_and_conf(self, annotated_user_phrase, bot_phrase, emotion, emotio
128128 state = random .choice (step ["next_step" ])
129129 elif state == "sad_and_lonely" and just_asked_about_jokes and is_no :
130130 reply = "Actually, I love jokes but not now. Dead serious about that."
131- confidence = 1.0
131+ confidence = 0.99
132132 state = ""
133133 elif state == "offered_advice" :
134134 # we offered an advice
@@ -140,7 +140,7 @@ def _get_reply_and_conf(self, annotated_user_phrase, bot_phrase, emotion, emotio
140140 state = random .choice (step ["next_step" ])
141141 else :
142142 state = ""
143- confidence = 0.95
143+ confidence = 0.8
144144 else :
145145 # provide advices and offer another one
146146 reply = self ._random_choice (self .advices [emotion ], prev_jokes_advices )
@@ -153,7 +153,7 @@ def _get_reply_and_conf(self, annotated_user_phrase, bot_phrase, emotion, emotio
153153 prev_jokes_advices .append (reply )
154154 if len (prev_jokes_advices ) == len (self .advices [emotion ]):
155155 state = "sad_and_lonely_end"
156- confidence = 1.0 if is_yes else 0.95
156+ confidence = 1.0 if is_yes else 0.8
157157 else :
158158 if emotion in ["sadness" , "fear" , "anger" ] and "joy" in state :
159159 state = "sad_and_lonely"
@@ -169,7 +169,7 @@ def _get_reply_and_conf(self, annotated_user_phrase, bot_phrase, emotion, emotio
169169 link = link_to ([link ], human_attributes = human_attr )
170170 link ["phrase" ] = reply
171171 # reply += link['phrase']
172- confidence = 0.95
172+ confidence = 0.8
173173
174174 emotion_skill_attributes = {"state" : state , "emotion" : emotion , "prev_jokes_advices" : prev_jokes_advices }
175175 if "joy" in state :
@@ -242,7 +242,7 @@ def __call__(self, dialogs):
242242 if talk_about_emotion (annotated_user_phrase , prev_annotated_bot_phrase ):
243243 reply = f"OK. { random .choice (skill_trigger_phrases ())} "
244244 attr ["can_continue" ] = MUST_CONTINUE
245- confidence = 1
245+ confidence = 1.0
246246 elif emotion != "neutral" or state != "" :
247247 reply , confidence , link , emotion_skill_attributes = self ._get_reply_and_conf (
248248 annotated_user_phrase , prev_bot_phrase , emotion , emotion_skill_attributes , human_attributes
0 commit comments