diff --git a/chapters/en/chapter7/section7.mdx b/chapters/en/chapter7/section7.mdx index f71c25bbd..7c90a923c 100644 --- a/chapters/en/chapter7/section7.mdx +++ b/chapters/en/chapter7/section7.mdx @@ -291,7 +291,7 @@ for i, offset in enumerate(inputs["offset_mapping"]): context_end = idx - 1 # If the answer is not fully inside the context, label is (0, 0) - if offset[context_start][0] > end_char or offset[context_end][1] < start_char: + if offset[context_start][0] > start_char or offset[context_end][1] < end_char: start_positions.append(0) end_positions.append(0) else: @@ -398,7 +398,7 @@ def preprocess_training_examples(examples): context_end = idx - 1 # If the answer is not fully inside the context, label is (0, 0) - if offset[context_start][0] > end_char or offset[context_end][1] < start_char: + if offset[context_start][0] > start_char or offset[context_end][1] < end_char: start_positions.append(0) end_positions.append(0) else: