ccdv commited on
Commit
d86d4c7
1 Parent(s): b41492a

add sections

Browse files
Files changed (1) hide show
  1. arxiv-summarization.py +12 -4
arxiv-summarization.py CHANGED
@@ -57,13 +57,18 @@ class ArxivSummarizationDataset(datasets.GeneratorBasedBuilder):
57
 
58
  BUILDER_CONFIGS = [
59
  ArxivSummarizationConfig(
60
- name="arxiv",
61
  version=datasets.Version("1.0.0"),
62
- description="Arxiv dataset for summarization",
 
 
 
 
 
63
  ),
64
  ]
65
 
66
- DEFAULT_CONFIG_NAME = "arxiv"
67
 
68
  def _info(self):
69
  # Should return a datasets.DatasetInfo object
@@ -112,6 +117,9 @@ class ArxivSummarizationDataset(datasets.GeneratorBasedBuilder):
112
  'section_names': List[str],
113
  'sections': List[List[str]]
114
  """
115
- article = data["article_text"]
 
 
 
116
  abstract = data["abstract_text"]
117
  yield id_, {"article": ' '.join(article), "abstract": ' '.join(abstract)}
 
57
 
58
  BUILDER_CONFIGS = [
59
  ArxivSummarizationConfig(
60
+ name="section",
61
  version=datasets.Version("1.0.0"),
62
+ description="Arxiv dataset for summarization, concatenated sections",
63
+ ),
64
+ ArxivSummarizationConfig(
65
+ name="document",
66
+ version=datasets.Version("1.0.0"),
67
+ description="Arxiv dataset for summarization, document",
68
  ),
69
  ]
70
 
71
+ DEFAULT_CONFIG_NAME = "section"
72
 
73
  def _info(self):
74
  # Should return a datasets.DatasetInfo object
 
117
  'section_names': List[str],
118
  'sections': List[List[str]]
119
  """
120
+ if self.config.name == "section":
121
+ article = data["article_text"]
122
+ else:
123
+ article = [item.strip() for sublist in data["sections"] for item in sublist]
124
  abstract = data["abstract_text"]
125
  yield id_, {"article": ' '.join(article), "abstract": ' '.join(abstract)}