Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
round f1_score in built_in qa eval flow
  • Loading branch information
qusongms committed Mar 22, 2024
commit 5530b172db4e15d427a3d20d7ce15bb20d628761
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def lower(text):
precision = 1.0 * num_common_tokens / len(prediction_tokens)
recall = 1.0 * num_common_tokens / len(reference_tokens)

f1 = (2.0 * precision * recall) / (precision + recall)
f1 = round(
(2.0 * precision * recall) / (precision + recall), 2)

return f1
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ nodes:
type: code
path: f1_score.py
inputs:
ground_truth: ${inputs.ground_truth}
answer: ${inputs.answer}
ground_truth: ${inputs.ground_truth}
activate:
when: ${validate_input.output.f1_score}
is: true
Expand Down