MCPcopy Create free account
hub / github.com/OpenBMB/DecT / YelpProcessor

Class YelpProcessor

src/process_data.py:260–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258 return examples
259
260class 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
282class RteProcessor(DataProcessor):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected