Skip to content

Commit

Permalink
Merge pull request google-research#132 from pengli09/fix-boundary-che…
Browse files Browse the repository at this point in the history
…cking-bug

fix boundary checking bug
  • Loading branch information
jacobdevlin-google authored Nov 16, 2018
2 parents 6045470 + 7bebe59 commit c8757ce
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions run_squad.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,7 @@ def convert_examples_to_features(examples, tokenizer, max_seq_length,
doc_start = doc_span.start
doc_end = doc_span.start + doc_span.length - 1
out_of_span = False
if (example.start_position < doc_start or
example.end_position < doc_start or
example.start_position > doc_end or example.end_position > doc_end):
if not (tok_start_position >= doc_start and tok_end_position <= doc_end):
out_of_span = True
if out_of_span:
start_position = 0
Expand Down

0 comments on commit c8757ce

Please sign in to comment.