Datasets:

Modalities:
Text
ArXiv:
Libraries:
Datasets
lovodkin93 commited on
Commit
c1cfd44
·
1 Parent(s): d0542df
Files changed (1) hide show
  1. Controlled-Text-Reduction-dataset.py +33 -14
Controlled-Text-Reduction-dataset.py CHANGED
@@ -128,7 +128,7 @@
128
  # ]
129
 
130
  # DEFAULT_CONFIG_NAME = (
131
- # "default" # It's not mandatory to have a default configuration. Just use one if it make sense.
132
  # )
133
 
134
  # def _info(self):
@@ -324,20 +324,28 @@ COLUMNS = ["doc_text", "summary_text", "highlight_spans"]
324
 
325
 
326
  # _URLs = {
327
- # "wikinews.train": "https://github.com/ValentinaPy/QADiscourse/raw/master/Dataset/wikinews_train.tsv",
328
- # "wikinews.dev": "https://github.com/ValentinaPy/QADiscourse/raw/master/Dataset/wikinews_dev.tsv",
329
- # "wikinews.test": "https://github.com/ValentinaPy/QADiscourse/raw/master/Dataset/wikinews_test.tsv",
330
- # "wikipedia.train": "https://github.com/ValentinaPy/QADiscourse/raw/master/Dataset/wikipedia_train.tsv",
331
- # "wikipedia.dev": "https://github.com/ValentinaPy/QADiscourse/raw/master/Dataset/wikipedia_dev.tsv",
332
- # "wikipedia.test": "https://github.com/ValentinaPy/QADiscourse/raw/master/Dataset/wikipedia_test.tsv",
 
 
 
 
333
  # }
334
 
335
- # COLUMNS = ['qasrl_id', 'sentence', 'worker_id', 'full_question', 'full_answer',
336
- # 'question_start', 'question_aux', 'question_body', 'answer',
337
- # 'untokenized sentence', 'target indices for untok sent']
 
 
 
 
 
338
 
339
 
340
- # TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
341
  class ControlledTectReduction(datasets.GeneratorBasedBuilder):
342
  """Controlled Text Reduction: dataset for the Controlled Text Reduction task ().
343
  Each data point consists of a document, a summary, and a list of spans of the document that are the pre-selected content whose summary is the summary"""
@@ -345,14 +353,25 @@ class ControlledTectReduction(datasets.GeneratorBasedBuilder):
345
 
346
  VERSION = datasets.Version("1.0.0")
347
 
 
 
348
  BUILDER_CONFIGS = [
349
- datasets.BuilderConfig(
350
- name="default", version=VERSION, description="This provides the Controlled Text Reduction dataset"
 
 
 
351
  ),
 
 
 
 
 
 
352
  ]
353
 
354
  DEFAULT_CONFIG_NAME = (
355
- "default" # It's not mandatory to have a default configuration. Just use one if it make sense.
356
  )
357
 
358
  def _info(self):
 
128
  # ]
129
 
130
  # DEFAULT_CONFIG_NAME = (
131
+ # "DUC-2001-2002" # It's not mandatory to have a default configuration. Just use one if it make sense.
132
  # )
133
 
134
  # def _info(self):
 
324
 
325
 
326
  # _URLs = {
327
+ # "DUC-2001-2002": {
328
+ # "dev": "https://github.com/lovodkin93/Controlled_Text_Reduction/tree/main/data/dev_DUC-2001-2002.csv",
329
+ # "test": "https://github.com/lovodkin93/Controlled_Text_Reduction/tree/main/data/test_DUC-2001-2002.csv",
330
+ # "train": "https://github.com/lovodkin93/Controlled_Text_Reduction/tree/main/data/train_DUC-2001-2002.csv"
331
+ # },
332
+ # "CNN-DM": {
333
+ # "train": "https://github.com/lovodkin93/Controlled_Text_Reduction/tree/main/data/train_CNNDM.csv",
334
+ # "dev": "https://github.com/lovodkin93/Controlled_Text_Reduction/tree/main/data/dev_DUC-2001-2002.csv",
335
+ # "test": "https://github.com/lovodkin93/Controlled_Text_Reduction/tree/main/data/test_DUC-2001-2002.csv",
336
+ # },
337
  # }
338
 
339
+
340
+ @dataclass
341
+ class ControlledTextReductionConfig(datasets.BuilderConfig):
342
+ """ Allow the loader to re-distribute the original dev and test splits between train, dev and test. """
343
+ data_source: str = "DUC-2001-2002" # "DUC-2001-2002" or "CNN-DM"
344
+
345
+
346
+
347
 
348
 
 
349
  class ControlledTectReduction(datasets.GeneratorBasedBuilder):
350
  """Controlled Text Reduction: dataset for the Controlled Text Reduction task ().
351
  Each data point consists of a document, a summary, and a list of spans of the document that are the pre-selected content whose summary is the summary"""
 
353
 
354
  VERSION = datasets.Version("1.0.0")
355
 
356
+ BUILDER_CONFIG_CLASS = ControlledTextReductionConfig
357
+
358
  BUILDER_CONFIGS = [
359
+ ControlledTextReductionConfig(
360
+ name="DUC-2001-2002",
361
+ version=VERSION,
362
+ description="This provides the Controlled Text Reduction dataset extracted from the DUC 2001-2002 Single Document Summarization benchmark",
363
+ data_source="DUC-2001-2002"
364
  ),
365
+ ControlledTextReductionConfig(
366
+ name="CNN-DM",
367
+ version=VERSION,
368
+ description="This provides the Controlled Text Reduction dataset extracted from the CNN-DM dataset (the train split)",
369
+ data_source="CNN-DM"
370
+ )
371
  ]
372
 
373
  DEFAULT_CONFIG_NAME = (
374
+ "DUC-2001-2002" # It's not mandatory to have a default configuration. Just use one if it make sense.
375
  )
376
 
377
  def _info(self):