Skip to content

Commit

Permalink
corrected ressult type inside function
Browse files Browse the repository at this point in the history
  • Loading branch information
Vivitsa Shankar authored and Vivitsa Shankar committed Jan 4, 2024
1 parent 9e6b32c commit 53b10d3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dialogy/plugins/text/dob_plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 53b10d3

Please sign in to comment.