Datasets:

Modalities:
Text
ArXiv:
Libraries:
Datasets
lovodkin93 commited on
Commit
0117c59
1 Parent(s): 58ff6ba

update script

Browse files
Controlled-Text-Reduction-dataset.py CHANGED
@@ -408,15 +408,41 @@ class ControlledTectReduction(datasets.GeneratorBasedBuilder):
408
  corpora = {section: Path(dl_manager.download_and_extract(URLs[section]))
409
  for section in URLs}
410
 
411
- return [
412
- datasets.SplitGenerator(
413
- name=datasets.Split.TRAIN,
414
- # These kwargs will be passed to _generate_examples
415
- gen_kwargs={
416
- "filepath": corpora["train"]
417
- },
418
- )
419
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
 
421
 
422
 
 
408
  corpora = {section: Path(dl_manager.download_and_extract(URLs[section]))
409
  for section in URLs}
410
 
411
+ if self.config.data_source=="CNN-DM":
412
+ return [
413
+ datasets.SplitGenerator(
414
+ name=datasets.Split.TRAIN,
415
+ # These kwargs will be passed to _generate_examples
416
+ gen_kwargs={
417
+ "filepath": corpora["train"]
418
+ },
419
+ ),
420
+ ]
421
+ else:
422
+
423
+ return [
424
+ datasets.SplitGenerator(
425
+ name=datasets.Split.TRAIN,
426
+ # These kwargs will be passed to _generate_examples
427
+ gen_kwargs={
428
+ "filepath": corpora["train"]
429
+ },
430
+ ),
431
+ datasets.SplitGenerator(
432
+ name=datasets.Split.VALIDATION,
433
+ # These kwargs will be passed to _generate_examples
434
+ gen_kwargs={
435
+ "filepath": corpora["dev"]
436
+ },
437
+ ),
438
+ datasets.SplitGenerator(
439
+ name=datasets.Split.TEST,
440
+ # These kwargs will be passed to _generate_examples
441
+ gen_kwargs={
442
+ "filepath": corpora["test"]
443
+ },
444
+ ),
445
+ ]
446
 
447
 
448