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

Commit

Permalink
fix incorrect logging in viterbi decode (#2982)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeNeutoy committed Jun 20, 2019
1 parent 51b74b1 commit 03aa838
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion allennlp/nn/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def viterbi_decode(tag_sequence: torch.Tensor,
observation = tag_observations[timestep]
# Warn the user if they have passed
# invalid/extremely unlikely evidence.
if tag_observations[timestep - 1] != -1:
if tag_observations[timestep - 1] != -1 and observation != -1:
if transition_matrix[tag_observations[timestep - 1], observation] < -10000:
logger.warning("The pairwise potential between tags you have passed as "
"observations is extremely unlikely. Double check your evidence "
Expand Down

0 comments on commit 03aa838

Please sign in to comment.