diff --git a/model/linear_crf_inferencer.py b/model/linear_crf_inferencer.py index a17652f..6252448 100644 --- a/model/linear_crf_inferencer.py +++ b/model/linear_crf_inferencer.py @@ -121,6 +121,7 @@ def backward(self, lstm_scores: torch.Tensor, word_seq_lens: torch.Tensor) -> to def forward_backward(self, lstm_scores: torch.Tensor, word_seq_lens: torch.Tensor) -> torch.Tensor: """ + Note: This function is not used unless you want to compute the marginal probability Forward-backward algorithm to compute the marginal probability (in log space) Basically, we follow the `backward` algorithm to obtain the backward scores. :param lstm_scores: shape: (batch_size, sent_len, label_size) NOTE: the score from LSTMs, not `all_scores` (which add up the transtiion)