INNER CODE UNIT · Python

InputFeatures

shibing624/pytextclassifier · pytextclassifier/bert_classfication_utils.py:233

class InputFeatures(object):
    """A single set of features of data."""

    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,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…