(self, task_name, dataset_name, datapaths,
tokenizer, max_seq_length)
| 29 | """GLUE base dataset class.""" |
| 30 | |
| 31 | def __init__(self, task_name, dataset_name, datapaths, |
| 32 | tokenizer, max_seq_length): |
| 33 | # Store inputs. |
| 34 | self.task_name = task_name |
| 35 | self.dataset_name = dataset_name |
| 36 | self.tokenizer = tokenizer |
| 37 | self.max_seq_length = max_seq_length |
| 38 | print_rank_0(' > building {} dataset for {}:'.format(self.task_name, |
| 39 | self.dataset_name)) |
| 40 | # Process the files. |
| 41 | string = ' > paths:' |
| 42 | for path in datapaths: |
| 43 | string += ' ' + path |
| 44 | print_rank_0(string) |
| 45 | self.samples = [] |
| 46 | for datapath in datapaths: |
| 47 | self.samples.extend(self.process_samples_from_single_path(datapath)) |
| 48 | print_rank_0(' >> total number of samples: {}'.format( |
| 49 | len(self.samples))) |
| 50 | |
| 51 | def __len__(self): |
| 52 | return len(self.samples) |
nothing calls this directly
no test coverage detected