Skip to content

Commit

Permalink
Ensure no empty mappings are passed in chat enrich
Browse files Browse the repository at this point in the history
  • Loading branch information
JeltevanBoheemen committed May 16, 2024
1 parent 03af295 commit 2a64e67
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/annotations/writers/saf_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def _items_by_utt_word(exactresults: ExactResultsDict, items_mapping: Dict) -> D

for (qid, _), hits in results.items():
for (utt_id, wordno) in hits:
out[utt_id][wordno].append(items_mapping.get(qid))
mapped = items_mapping.get(qid)
if mapped:
out[utt_id][wordno].append(mapped)

return out

Expand All @@ -38,7 +40,6 @@ def find_doc_line_xsid(lines: List[ChatLine], xsid: int) -> ChatLine:
return None



def enrich_chat(transcript: Transcript,
allresults: AllResults,
method: AssessmentMethod) -> ChatDocument:
Expand Down

0 comments on commit 2a64e67

Please sign in to comment.