def create_tokens_and_token_types(self, tokens_a, tokens_b):
    'Merge segments A and B, add [CLS] and [SEP] and build token types.'
    tokens = (([self.cls_id] + tokens_a) + [self.sep_id])
    token_types = ([0] * (len(tokens_a) + 2))
    if (len(tokens_b) > 0):
        tokens = ((tokens + tokens_b) + [self.sep_id])
        token_types = (token_types + ([1] * (len(tokens_b) + 1)))
    return (tokens, token_types)
Merge segments A and B, add [CLS] and [SEP] and build token types.
def create_tokens_and_token_types(self, tokens_a, tokens_b):
    
    tokens = (([self.cls_id] + tokens_a) + [self.sep_id])
    token_types = ([0] * (len(tokens_a) + 2))
    if (len(tokens_b) > 0):
        tokens = ((tokens + tokens_b) + [self.sep_id])
        token_types = (token_types + ([1] * (len(tokens_b) + 1)))
    return (tokens, token_types)