From db95b4ab89f4e3406b166c42583837ff47d62fc8 Mon Sep 17 00:00:00 2001 From: louishsu Date: Sat, 23 Oct 2021 21:15:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dspan=E7=BC=96=E7=A0=81bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run_span.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_span.py b/run_span.py index c0bc929..3f501c5 100644 --- a/run_span.py +++ b/run_span.py @@ -817,7 +817,7 @@ def _convert_example_to_feature(self, example): inputs["input_len"] = inputs["attention_mask"].sum(dim=1) # for special tokens input_len = inputs["input_len"].item() inputs["spans"], inputs["span_mask"] = self._encode_span( - input_len, input_len, sent_start, sent_end) # dynamic batch + input_len, input_len, sent_start + 1, sent_end + 1) # dynamic batch inputs["sent_start"] = torch.tensor([sent_start]) inputs["sent_end"] = torch.tensor([sent_end])