INNER CODE UNIT · Python
__init__
shibing624/pytextclassifier · pytextclassifier/bert_classfication_utils.py:236
def __init__(self, input_ids, input_mask, segment_ids, label_id):
self.input_ids = input_ids
self.input_mask = input_mask
self.segment_ids = segment_ids
self.label_id = label_id
def preprocess_data_multiprocessing(data):
text_a, text_b, tokenizer, max_seq_length = data
examples = tokenizer(
text=text_a,
text_pair=text_b,
max_length=max_seq_length,
truncation=True,
padding="max_length",
return_tensors="pt",
)