Change the example code to use encode_plus since the token_type_id wasn't being correctly set.
token_type_id is converted into the segment embedding. For question answering, this needs to highlight whether a token belongs to sequence 0 or 1. encode_plus takes care of correctly setting this parameter automatically.