Skip to content

Commit

Permalink
added a filtering step (if v is not None) in sorted_result inside get…
Browse files Browse the repository at this point in the history
…_transcripts_from_utterances function to handle annotation type fail
  • Loading branch information
Vivitsa Shankar authored and Vivitsa Shankar committed Jan 4, 2024
1 parent 913c025 commit f5e4fa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dialogy/plugins/text/dob_plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def get_transcripts_from_utterances(utterances: List[Utterance], func_transcript
result_dict[result] = confidence

# Sort the result_dict based on confidence in descending order
sorted_result = {k: v for k, v in sorted(result_dict.items(), key=lambda item: item[1], reverse=True)}
sorted_result = {k: v for k, v in sorted(result_dict.items(), key=lambda item: item[1], reverse=True) if v is not None}
transcripts = sorted(sorted_result, key=lambda x: sorted_result[x], reverse=True)

return transcripts
Expand Down

0 comments on commit f5e4fa0

Please sign in to comment.