Skip to content

Commit

Permalink
修复span编码bug
Browse files Browse the repository at this point in the history
  • Loading branch information
louishsu committed Oct 23, 2021
1 parent 6a0c57e commit db95b4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion run_span.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down

0 comments on commit db95b4a

Please sign in to comment.