diff --git a/supar/models/const/crf/parser.py b/supar/models/const/crf/parser.py index d1627657..4a57de5d 100644 --- a/supar/models/const/crf/parser.py +++ b/supar/models/const/crf/parser.py @@ -121,7 +121,7 @@ def pred_step(self, batch: Batch) -> Batch: batch.trees = [Tree.build(tree, [(i, j, self.CHART.vocab[label]) for i, j, label in chart]) for tree, chart in zip(trees, chart_preds)] if self.args.prob: - batch.probs = [prob[:i-1, 1:i].cpu() for i, prob in zip(lens, s_span)] + batch.probs = [prob[:i, 1:i+1].cpu() for i, prob in zip(lens, s_span)] return batch @classmethod