gossminn commited on
Commit
5f5475b
1 Parent(s): cb6b664

Bugfix: show 'unknown' if distance can't be computed

Browse files
Files changed (1) hide show
  1. fillmorle/app.py +2 -2
fillmorle/app.py CHANGED
@@ -420,8 +420,8 @@ def format_feedback(frame_feedback):
420
  for fdb in frame_feedback:
421
  out.append({
422
  "Story": fdb["frame"],
423
- "Similarity (Event)": f"{fdb['similarity_1']:.2f}",
424
- "Similarity (Thing)": f"{fdb['similarity_2']:.2f}",
425
  "Typical Context": fdb["typical_sentence"],
426
  "Typical Words": " ".join(fdb["typical_words"])
427
  })
 
420
  for fdb in frame_feedback:
421
  out.append({
422
  "Story": fdb["frame"],
423
+ "Similarity (Event)": f"{fdb['similarity_1']:.2f}" if fdb["similarity_1"] else "unknown",
424
+ "Similarity (Thing)": f"{fdb['similarity_2']:.2f}" if fdb["similarity_2"] else "unknown",
425
  "Typical Context": fdb["typical_sentence"],
426
  "Typical Words": " ".join(fdb["typical_words"])
427
  })