(self, path, process_fn, with_heads=True, **kwargs)
| 69 | |
| 70 | class TSVDataset(Dataset): |
| 71 | def __init__(self, path, process_fn, with_heads=True, **kwargs): |
| 72 | self.process_fn = process_fn |
| 73 | with open(path, 'r') as fin: |
| 74 | if with_heads: |
| 75 | self.heads = fin.readline().split('\t') |
| 76 | else: |
| 77 | self.heads = None |
| 78 | self.items = [line.split('\t') for line in fin] |
| 79 | |
| 80 | def __len__(self): |
| 81 | return len(self.items) |
nothing calls this directly
no outgoing calls
no test coverage detected