def read_dataset(args, dataset):
path = os.path.join(vars(args)[dataset])<EOL>logger.info('<STR_LIT>'.format(path))<EOL>examples = [line.strip().split('<STR_LIT:\t>') for line in open(path)]<EOL>if args.max_num_examples > <NUM_LIT:0>:<EOL><INDENT>examples = examples[:args.max_num_examples]<EOL><DEDENT>dataset = gluon.data.SimpleDataset([(e[<NUM_LIT:0>], e[<NUM_LIT:1>], LABEL_TO_IDX[e[<NUM_LIT:2>]]) for e in examples])<EOL>dataset = dataset.transform(lambda s1, s2, label: (<EOL>['<STR_LIT>'] + s1.lower().split(),<EOL>['<STR_LIT>'] + s2.lower().split(), label),<EOL>lazy=False)<EOL>logger.info('<STR_LIT>'.format(len(dataset)))<EOL>return dataset<EOL>
Read dataset from tokenized files.