| 258 | return examples |
| 259 | |
| 260 | class YelpProcessor(DataProcessor): |
| 261 | dataset_project = {"train": "train", |
| 262 | "dev": "train", |
| 263 | "test": "test" |
| 264 | } |
| 265 | def __init__(self): |
| 266 | super().__init__() |
| 267 | self.labels = ["1", "2"] |
| 268 | |
| 269 | def get_examples(self, data_dir, split): |
| 270 | path = os.path.join(data_dir, "{}.csv".format(self.dataset_project[split])) |
| 271 | df = pd.read_csv(path, header=None) |
| 272 | examples = [] |
| 273 | for idx, (label, text) in enumerate(zip(df[0], df[1])): |
| 274 | text_a = text |
| 275 | label = self.get_label_id(str(label)) |
| 276 | example = InputExample( |
| 277 | guid=str(idx), text_a=text_a, text_b="", label=label) |
| 278 | examples.append(example) |
| 279 | return examples |
| 280 | |
| 281 | |
| 282 | class RteProcessor(DataProcessor): |
nothing calls this directly
no outgoing calls
no test coverage detected