(self, data_dir, split)
| 241 | self.labels = ["contradiction", "entailment", "neutral"] |
| 242 | |
| 243 | def get_examples(self, data_dir, split): |
| 244 | path = os.path.join(data_dir, "{}.jsonl".format(self.dataset_project[split])) |
| 245 | examples = [] |
| 246 | with open(path)as f: |
| 247 | lines = f.readlines() |
| 248 | for idx, line in enumerate(lines): |
| 249 | data = json.loads(line) |
| 250 | text_a = data["sentence1"] |
| 251 | text_b = data["sentence2"] |
| 252 | if data["gold_label"] not in self.labels: |
| 253 | continue |
| 254 | label = self.get_label_id(data["gold_label"]) |
| 255 | example = InputExample( |
| 256 | guid=str(idx), text_a=text_a, text_b=text_b, label=label) |
| 257 | examples.append(example) |
| 258 | return examples |
| 259 | |
| 260 | class YelpProcessor(DataProcessor): |
| 261 | dataset_project = {"train": "train", |
nothing calls this directly
no outgoing calls
no test coverage detected