Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 03aa838

Browse files
authored
fix incorrect logging in viterbi decode (#2982)
1 parent 51b74b1 commit 03aa838

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

allennlp/nn/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ def viterbi_decode(tag_sequence: torch.Tensor,
509509
observation = tag_observations[timestep]
510510
# Warn the user if they have passed
511511
# invalid/extremely unlikely evidence.
512-
if tag_observations[timestep - 1] != -1:
512+
if tag_observations[timestep - 1] != -1 and observation != -1:
513513
if transition_matrix[tag_observations[timestep - 1], observation] < -10000:
514514
logger.warning("The pairwise potential between tags you have passed as "
515515
"observations is extremely unlikely. Double check your evidence "

0 commit comments

Comments
 (0)