def __init__(self, dataset_list, tokenizer, opt):
    lines = load_apc_datasets(dataset_list)
    all_data = []
    label_set = set()
    for i in tqdm.tqdm(range(len(lines)), postfix='building word indices...'):
        line = lines[i].strip().split('$LABEL$')
        (text, label) = (line[0], line[1])
        text = text.strip().lower()
        label = label.strip().lower()
        text_indices = tokenizer.text_to_sequence('[CLS] {} [SEP]'.format(text))
        label = int(label)
        data = {'text_bert_indices': text_indices, 'label': label}
        label_set.add(label)
        all_data.append(data)
    check_and_fix_labels(label_set, 'label', all_data)
    opt.polarities_dim = len(label_set)
    self.data = all_data
def __init__(self, dataset_list, tokenizer, opt):
    lines = load_apc_datasets(dataset_list)
    all_data = []
    label_set = set()
    for i in tqdm.tqdm(range(len(lines)), postfix='building word indices...'):
        line = lines[i].strip().split('$LABEL$')
        (text, label) = (line[0], line[1])
        text = text.strip().lower()
        label = label.strip().lower()
        text_indices = tokenizer.text_to_sequence('[CLS] {} [SEP]'.format(text))
        label = int(label)
        data = {'text_bert_indices': text_indices, 'label': label}
        label_set.add(label)
        all_data.append(data)
    check_and_fix_labels(label_set, 'label', all_data)
    opt.polarities_dim = len(label_set)
    self.data = all_data