(self, data_dir, split)
| 133 | self.labels = ["company", "school", "artist", "athlete", "politics", "transportation", "building", "river", "village", "animal", "plant", "album", "film", "book",] |
| 134 | |
| 135 | def get_examples(self, data_dir, split): |
| 136 | examples = [] |
| 137 | label_file = open(os.path.join(data_dir,"{}_labels.txt".format(split)),'r') |
| 138 | labels = [int(x.strip()) for x in label_file.readlines()] |
| 139 | with open(os.path.join(data_dir,'{}.txt'.format(split)),'r') as fin: |
| 140 | for idx, line in enumerate(fin): |
| 141 | splited = line.strip().split(". ") |
| 142 | text_a, text_b = splited[0], splited[1:] |
| 143 | text_a = text_a+"." |
| 144 | text_b = ". ".join(text_b) |
| 145 | example = InputExample(guid=str(idx), text_a=text_a, text_b=text_b, label=int(labels[idx])) |
| 146 | examples.append(example) |
| 147 | return examples |
| 148 | |
| 149 | |
| 150 | class ImdbProcessor(DataProcessor): |
nothing calls this directly
no outgoing calls
no test coverage detected