sgnlp.models.emotion_entailment.utils.get_all_evidence_utterance_from_conversation¶
-
get_all_evidence_utterance_from_conversation
(emotion: str, conversation_history: List[str]) → Dict[str, List[str]][source]¶ Iterate through a conversation history to let each utterance be the evidence utterance. The last utterance is treated as the target utterance. Ouput dictionary is in a format which can be used with RecconEmotionEntailmentPreprocessor
- Parameters
emotion (str) – Emotion of the target utterance
conversation_history (List[str]) – List of utterance in a conversation. The last utterance is used as the target utterance.
- Returns
- Dictionary in a format that can be used with RecconEmotionEntailmentPreprocessor
The dictionary looks like this: {‘emotion’: [‘happiness’], ‘target_utterance’: [‘……’], ‘evidence_utterance’: [‘……’], ‘conversation_history’: [‘……’]}
- Return type
Dict[str, List[str]]