(self, json_file, text_key)
| 7 | |
| 8 | class TextDataset(torch.utils.data.Dataset): |
| 9 | def __init__(self, json_file, text_key): |
| 10 | |
| 11 | self.data_list = json.load(open(json_file, 'r')) |
| 12 | self.data_list = [data for data in self.data_list if data[text_key] is not None] |
| 13 | self.text_key = text_key |
| 14 | |
| 15 | def __getitem__(self, data_id): |
| 16 | data = self.data_list[data_id] |
nothing calls this directly
no outgoing calls
no test coverage detected