Force the return of token type IDs (#3439)

This commit is contained in:
Lysandre Debut
2020-03-26 04:41:36 -04:00
committed by GitHub
parent 010e0460b2
commit ffcffebe85
2 changed files with 4 additions and 1 deletions

View File

@@ -139,6 +139,7 @@ def squad_convert_example_to_features(example, max_seq_length, doc_stride, max_q
pad_to_max_length=True,
stride=max_seq_length - doc_stride - len(truncated_query) - sequence_pair_added_tokens,
truncation_strategy="only_second" if tokenizer.padding_side == "right" else "only_first",
return_token_type_ids=True,
)
paragraph_len = min(