This commit is contained in:
kadarakos 2023-05-09 11:32:02 +00:00
parent e5b2a8b506
commit 11a17976ec

View File

@ -64,7 +64,9 @@ def test_loss_alignment_example(tokens_predicted, tokens_reference, reference_tr
span_finder = nlp.add_pipe("span_finder", config={"training_key": TRAINING_KEY})
nlp.initialize()
if predicted.text != reference.text:
with pytest.raises(ValueError, match="must match between reference and predicted"):
with pytest.raises(
ValueError, match="must match between reference and predicted"
):
span_finder._get_aligned_truth_scores([example])
return
truth_scores = span_finder._get_aligned_truth_scores([example])