(self, data_dir, split)
| 187 | ,"Family & Relationships", "Politics & Government"] |
| 188 | |
| 189 | def get_examples(self, data_dir, split): |
| 190 | path = os.path.join(data_dir, "{}.csv".format(split)) |
| 191 | examples = [] |
| 192 | with open(path, encoding='utf8') as f: |
| 193 | reader = csv.reader(f, delimiter=',') |
| 194 | for idx, row in enumerate(reader): |
| 195 | label, question_title, question_body, answer = row |
| 196 | text_a = ' '.join([question_title.replace('\\n', ' ').replace('\\', ' '), |
| 197 | question_body.replace('\\n', ' ').replace('\\', ' ')]) |
| 198 | text_b = answer.replace('\\n', ' ').replace('\\', ' ') |
| 199 | example = InputExample(guid=str(idx), text_a=text_a, text_b=text_b, label=int(label)-1) |
| 200 | examples.append(example) |
| 201 | return examples |
| 202 | |
| 203 | |
| 204 | class SST2Processor(DataProcessor): |
nothing calls this directly
no outgoing calls
no test coverage detected