Convert dataset to Parquet

#7
by albertvillanova HF staff - opened
Files changed (36) hide show
  1. README.md +55 -0
  2. arxiv-summarization.py +0 -130
  3. vocab.zip → document/test-00000-of-00001.parquet +2 -2
  4. test.zip → document/train-00000-of-00015.parquet +2 -2
  5. val.zip → document/train-00001-of-00015.parquet +2 -2
  6. train.zip → document/train-00002-of-00015.parquet +2 -2
  7. document/train-00003-of-00015.parquet +3 -0
  8. document/train-00004-of-00015.parquet +3 -0
  9. document/train-00005-of-00015.parquet +3 -0
  10. document/train-00006-of-00015.parquet +3 -0
  11. document/train-00007-of-00015.parquet +3 -0
  12. document/train-00008-of-00015.parquet +3 -0
  13. document/train-00009-of-00015.parquet +3 -0
  14. document/train-00010-of-00015.parquet +3 -0
  15. document/train-00011-of-00015.parquet +3 -0
  16. document/train-00012-of-00015.parquet +3 -0
  17. document/train-00013-of-00015.parquet +3 -0
  18. document/train-00014-of-00015.parquet +3 -0
  19. document/validation-00000-of-00001.parquet +3 -0
  20. section/test-00000-of-00001.parquet +3 -0
  21. section/train-00000-of-00015.parquet +3 -0
  22. section/train-00001-of-00015.parquet +3 -0
  23. section/train-00002-of-00015.parquet +3 -0
  24. section/train-00003-of-00015.parquet +3 -0
  25. section/train-00004-of-00015.parquet +3 -0
  26. section/train-00005-of-00015.parquet +3 -0
  27. section/train-00006-of-00015.parquet +3 -0
  28. section/train-00007-of-00015.parquet +3 -0
  29. section/train-00008-of-00015.parquet +3 -0
  30. section/train-00009-of-00015.parquet +3 -0
  31. section/train-00010-of-00015.parquet +3 -0
  32. section/train-00011-of-00015.parquet +3 -0
  33. section/train-00012-of-00015.parquet +3 -0
  34. section/train-00013-of-00015.parquet +3 -0
  35. section/train-00014-of-00015.parquet +3 -0
  36. section/validation-00000-of-00001.parquet +3 -0
README.md CHANGED
@@ -11,6 +11,61 @@ task_categories:
11
  task_ids: []
12
  tags:
13
  - conditional-text-generation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  train-eval-index:
15
  - config: document
16
  task: summarization
 
11
  task_ids: []
12
  tags:
13
  - conditional-text-generation
14
+ dataset_info:
15
+ - config_name: document
16
+ features:
17
+ - name: article
18
+ dtype: string
19
+ - name: abstract
20
+ dtype: string
21
+ splits:
22
+ - name: train
23
+ num_bytes: 7118099012
24
+ num_examples: 203037
25
+ - name: validation
26
+ num_bytes: 216177092
27
+ num_examples: 6436
28
+ - name: test
29
+ num_bytes: 216560120
30
+ num_examples: 6440
31
+ download_size: 3614462676
32
+ dataset_size: 7550836224
33
+ - config_name: section
34
+ features:
35
+ - name: article
36
+ dtype: string
37
+ - name: abstract
38
+ dtype: string
39
+ splits:
40
+ - name: train
41
+ num_bytes: 7201498856
42
+ num_examples: 203037
43
+ - name: validation
44
+ num_bytes: 218793173
45
+ num_examples: 6436
46
+ - name: test
47
+ num_bytes: 219196348
48
+ num_examples: 6440
49
+ download_size: 3649452807
50
+ dataset_size: 7639488377
51
+ configs:
52
+ - config_name: document
53
+ data_files:
54
+ - split: train
55
+ path: document/train-*
56
+ - split: validation
57
+ path: document/validation-*
58
+ - split: test
59
+ path: document/test-*
60
+ - config_name: section
61
+ data_files:
62
+ - split: train
63
+ path: section/train-*
64
+ - split: validation
65
+ path: section/validation-*
66
+ - split: test
67
+ path: section/test-*
68
+ default: true
69
  train-eval-index:
70
  - config: document
71
  task: summarization
arxiv-summarization.py DELETED
@@ -1,130 +0,0 @@
1
- import json
2
- import os
3
-
4
- import datasets
5
- from datasets.tasks import TextClassification
6
-
7
- _CITATION = None
8
-
9
-
10
- _DESCRIPTION = """
11
- Arxiv dataset for summarization.
12
- From paper: A Discourse-Aware Attention Model for Abstractive Summarization of Long Documents" by A. Cohan et al.
13
- See: https://aclanthology.org/N18-2097.pdf
14
- See: https://github.com/armancohan/long-summarization
15
- """
16
- _CITATION = """\
17
- @inproceedings{cohan-etal-2018-discourse,
18
- title = "A Discourse-Aware Attention Model for Abstractive Summarization of Long Documents",
19
- author = "Cohan, Arman and
20
- Dernoncourt, Franck and
21
- Kim, Doo Soon and
22
- Bui, Trung and
23
- Kim, Seokhwan and
24
- Chang, Walter and
25
- Goharian, Nazli",
26
- booktitle = "Proceedings of the 2018 Conference of the North {A}merican Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers)",
27
- month = jun,
28
- year = "2018",
29
- address = "New Orleans, Louisiana",
30
- publisher = "Association for Computational Linguistics",
31
- url = "https://aclanthology.org/N18-2097",
32
- doi = "10.18653/v1/N18-2097",
33
- pages = "615--621",
34
- abstract = "Neural abstractive summarization models have led to promising results in summarizing relatively short documents. We propose the first model for abstractive summarization of single, longer-form documents (e.g., research papers). Our approach consists of a new hierarchical encoder that models the discourse structure of a document, and an attentive discourse-aware decoder to generate the summary. Empirical results on two large-scale datasets of scientific papers show that our model significantly outperforms state-of-the-art models.",
35
- }
36
- """
37
- _ABSTRACT = "abstract"
38
- _ARTICLE = "article"
39
-
40
- class ArxivSummarizationConfig(datasets.BuilderConfig):
41
- """BuilderConfig for ArxivSummarization."""
42
-
43
- def __init__(self, **kwargs):
44
- """BuilderConfig for ArxivSummarization.
45
- Args:
46
- **kwargs: keyword arguments forwarded to super.
47
- """
48
- super(ArxivSummarizationConfig, self).__init__(**kwargs)
49
-
50
-
51
- class ArxivSummarizationDataset(datasets.GeneratorBasedBuilder):
52
- """ArxivSummarization Dataset."""
53
-
54
- _TRAIN_FILE = "train.zip"
55
- _VAL_FILE = "val.zip"
56
- _TEST_FILE = "test.zip"
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
75
- return datasets.DatasetInfo(
76
- description=_DESCRIPTION,
77
- features=datasets.Features(
78
- {
79
- _ARTICLE: datasets.Value("string"),
80
- _ABSTRACT: datasets.Value("string"),
81
- #"id": datasets.Value("string"),
82
- }
83
- ),
84
- supervised_keys=None,
85
- homepage="https://github.com/armancohan/long-summarization",
86
- citation=_CITATION,
87
- )
88
-
89
- def _split_generators(self, dl_manager):
90
-
91
- train_path = os.path.join(dl_manager.download_and_extract(self._TRAIN_FILE), "train.txt")
92
- val_path = os.path.join(dl_manager.download_and_extract(self._VAL_FILE), "val.txt")
93
- test_path = os.path.join(dl_manager.download_and_extract(self._TEST_FILE), "test.txt")
94
-
95
- return [
96
- datasets.SplitGenerator(
97
- name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}
98
- ),
99
- datasets.SplitGenerator(
100
- name=datasets.Split.VALIDATION, gen_kwargs={"filepath": val_path}
101
- ),
102
- datasets.SplitGenerator(
103
- name=datasets.Split.TEST, gen_kwargs={"filepath": test_path}
104
- ),
105
- ]
106
-
107
- def _generate_examples(self, filepath):
108
- """Generate ArxivSummarization examples."""
109
- with open(filepath, encoding="utf-8") as f:
110
- for id_, row in enumerate(f):
111
- data = json.loads(row)
112
-
113
- """
114
- 'article_id': str,
115
- 'abstract_text': List[str],
116
- 'article_text': List[str],
117
- 'section_names': List[str],
118
- 'sections': List[List[str]]
119
- """
120
-
121
- if self.config.name == "document":
122
- article = [d.strip() for d in data["article_text"]]
123
- article = " ".join(article)
124
- else:
125
- article = [item.strip() for sublist in data["sections"] for item in sublist]
126
- article = " \n ".join(article)
127
-
128
- abstract = [ab.replace("<S>", "").replace("</S>", "").strip() for ab in data["abstract_text"]]
129
- abstract = " \n ".join(abstract)
130
- yield id_, {"article": article, "abstract": abstract}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vocab.zip → document/test-00000-of-00001.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4be27a7b188a365672a2c1ed14f3095de3eea396cf8d3efaf93a034e6f6a3771
3
- size 1079675
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b34529dfeab4aabd4754cecc1603336a3449f66efee87f9b37192aa4c9dd91a1
3
+ size 104415058
test.zip → document/train-00000-of-00015.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8ee7cf45fde92768515e2f3170ecb1cf9bdae60169f2b4d4f9b60f1f628e862c
3
- size 102183593
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f03bb7fa31cdc12b2af71d5879e720ad97105981705881acca3296292ebb1b0
3
+ size 227377097
val.zip → document/train-00001-of-00015.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2e7d0cfebe4dc85868dff5553ad8efb09933efbd773eb66ce07cce81b9523791
3
- size 102038141
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20917de6d6d00cf16a8bdc8b619584319d36df18c7e074b0d76618564de300e4
3
+ size 226301801
train.zip → document/train-00002-of-00015.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fe5a49635c90f3bc75deeee5b8272c64fb123a59b1462ca2f3cca4a6e94cc78b
3
- size 3364100438
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eda7e19654a6ba2527b9592c620af1dd09c0e00e83c2cf2a5d84d1c3004cb730
3
+ size 225811302
document/train-00003-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:720a7fe463300e93accfef50cb429f95ba19d61e986f5dc3898bc9b5e3d5f477
3
+ size 224739740
document/train-00004-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:86d5ece70fbbe3b25eea12c3bbeafeb504d08dac8fec03fa719c2583d58a27b0
3
+ size 224221981
document/train-00005-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d0e37d171213fea299fedcc4bba378b8edb203560375ca39bbbee3aa4fb6096
3
+ size 224739675
document/train-00006-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e701cd82d9a1ceb7006fecf24ec1d0a7c363fc28cf55067afe4fb7c94d41b71
3
+ size 226420470
document/train-00007-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d97afff6b656833498b926284c3fa28a8dc12205c6592d712a0f0cad2b220b8
3
+ size 227648796
document/train-00008-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1fd7b48ddf66b67e1fdfc234ddb228ed65f0f518b3396ff778a85ce5bb3af6bf
3
+ size 228182156
document/train-00009-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1ecf6da96cfecb06ec703b9d2d12027715c0f7fb9a9cefe74a90f3599796d90
3
+ size 225869069
document/train-00010-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d3785dc96513eb1b3c86d36412dea3fdd575b7abb7ab8df2cafd41915a7579b
3
+ size 227292452
document/train-00011-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d72173926dacf5cec0ca231cd5a36296e210d06ba8d744a9ceb9bf06f015c3ee
3
+ size 229115987
document/train-00012-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:feba099d77f85c3a092e7da40cdf8280d7cf36794a7c23c4046e795b2f8488d7
3
+ size 227901684
document/train-00013-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:694f0c29f1e4164b141d63dba90d33f1120c72c81f632dd344a7e64cb2e12f02
3
+ size 227781020
document/train-00014-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91135ee12cd7c17a95c1abfbdc2ff0bbc4b544bb9359b40a0f47843b57c30a0f
3
+ size 232560678
document/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3583598a4d5bc660629ba8418edb4c8d969e1f4423e6c27b6208b8d88a105595
3
+ size 104083710
section/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ace777ab327eee0b1a1175e4e8e0f0049d14afa918c31c4f1d1d5ef43e9037d
3
+ size 105458672
section/train-00000-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9dbe40f121e3871ec36b1df51f499e1cc21d2021121fef5339fffa644741b12
3
+ size 229594302
section/train-00001-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a5375efb48d3b971d9f8c76468f86238eee09f87b535c1423829912eba64ff2a
3
+ size 228483557
section/train-00002-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f238195ac6fe0627399cdba117d697fd75f2e998043a9908ab37edec56160004
3
+ size 227983974
section/train-00003-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40edd38d8e6f85f811229972faa7bba2561363c8ec8a6cccbff2f9f0ef62dfbe
3
+ size 226907293
section/train-00004-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fcd41f448b5bcd8343ea6e223c5210c41f5d79614a4f2c1370ddc639120acde1
3
+ size 226392986
section/train-00005-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac2e4a7a82f94793c441b268eaed5453ae25a291b5d9cf0ec32a966596d7322c
3
+ size 226931821
section/train-00006-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f0f200dae532c23100a820aac71313ee1974c1fcb0e56fdadbb0a9296ea7495
3
+ size 228596794
section/train-00007-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a880b873584f8bfde6535537297f23e60df54a595934145507cbc544b1e3409a
3
+ size 229846795
section/train-00008-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa8651cd4c560fbfdc74ccd64be48321871da3dbc55b2a4020b505d6f5d29f37
3
+ size 230388735
section/train-00009-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7df66af4bf6ff3b47b0fe94683bba701dc6b9bcadec3c7c3b1abbfc45cdaa49b
3
+ size 228027386
section/train-00010-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc81aec50370abbc322499b28db664423a40577e4598167d2c2925843b9ec90c
3
+ size 229472090
section/train-00011-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:009427e23d6c4e80afa5d0c8606aef4eaf1fe780a08461a3bd0a755845feb166
3
+ size 231347864
section/train-00012-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5b102e77441cd751a426d78bbf4fbefc44b0bbefe846cc7fe338ecc75bd4e8e6
3
+ size 230123135
section/train-00013-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e056d260a92f05143d278a515e81bc717b42894dae13b69c95eedbc377dc4b0
3
+ size 230000935
section/train-00014-of-00015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:27d36c013889c3fb83de2c02b9794dcda66f502dd4ae4f5b41c39b6b57390285
3
+ size 234787773
section/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f43e5bbf32e9d1ef38a1dcff7d44ca8e4a31dae20384d0f4a424136d0b286fdf
3
+ size 105108695