diff --git a/dialogy/plugins/text/dob_plugin/__init__.py b/dialogy/plugins/text/dob_plugin/__init__.py index 382cefca..35965c9c 100644 --- a/dialogy/plugins/text/dob_plugin/__init__.py +++ b/dialogy/plugins/text/dob_plugin/__init__.py @@ -125,14 +125,18 @@ def get_transcripts_from_utterances(utterances: List[Utterance], func_transcript """ result_dict: Dict[str, float] = {} result: str = "" + transcripts: List[str] = [] + for utterance_set in utterances: for utterance in utterance_set: transcript = utterance.get('transcript') confidence = utterance.get('confidence') confidence = 0 if confidence is None else confidence # Ensure confidence is not None - result = func_transcript(transcript) - if result==None: + if func_transcript(transcript)!=None: + result = func_transcript(transcript) + else: result = "" + if result=="": confidence = 0 if result in result_dict: result_dict[result] += confidence