acul
commited on
Commit
•
4032cbe
1
Parent(s):
b22ff63
add 2021_21 snapshot
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- 2021_21/dedup/oscar-000000000001.json.gz +3 -0
- 2021_21/dedup/oscar-000000000002.json.gz +3 -0
- 2021_21/dedup/oscar-000000000003.json.gz +3 -0
- 2021_21/dedup/oscar-000000000004.json.gz +3 -0
- 2021_21/dedup/oscar-000000000005.json.gz +3 -0
- 2021_21/dedup/oscar-000000000006.json.gz +3 -0
- 2021_21/dedup/oscar-000000000007.json.gz +3 -0
- 2021_21/dedup/oscar-000000000008.json.gz +3 -0
- 2021_21/dedup/oscar-000000000009.json.gz +3 -0
- 2021_21/dedup/oscar-000000000010.json.gz +3 -0
- 2021_21/dedup/oscar-000000000011.json.gz +3 -0
- 2021_21/dedup/oscar-000000000012.json.gz +3 -0
- 2021_21/dedup/oscar-000000000013.json.gz +3 -0
- 2021_21/dedup/oscar-000000000014.json.gz +3 -0
- 2021_21/dedup/oscar-000000000015.json.gz +3 -0
- 2021_21/dedup/oscar-000000000016.json.gz +3 -0
- 2021_21/dedup/oscar-000000000017.json.gz +3 -0
- 2021_21/dedup/oscar-000000000018.json.gz +3 -0
- 2021_21/dedup/oscar-000000000019.json.gz +3 -0
- 2021_21/dedup/oscar-000000000020.json.gz +3 -0
- 2021_21/dedup/oscar-000000000021.json.gz +3 -0
- 2021_21/dedup/oscar-000000000022.json.gz +3 -0
- 2021_21/dedup/oscar-000000000023.json.gz +3 -0
- 2021_21/dedup/oscar-000000000024.json.gz +3 -0
- 2021_21/dedup/oscar-000000000025.json.gz +3 -0
- 2021_21/dedup/oscar-000000000026.json.gz +3 -0
- 2021_21/dedup/oscar-000000000027.json.gz +3 -0
- 2021_21/dedup/oscar-000000000028.json.gz +3 -0
- 2021_21/dedup/oscar-000000000029.json.gz +3 -0
- 2021_21/dedup/oscar-000000000030.json.gz +3 -0
- 2021_21/dedup/oscar-000000000031.json.gz +3 -0
- 2021_21/dedup/oscar-000000000032.json.gz +3 -0
- 2021_21/dedup/oscar-000000000033.json.gz +3 -0
- 2021_21/dedup/oscar-000000000034.json.gz +3 -0
- 2021_21/dedup/oscar-000000000035.json.gz +3 -0
- 2021_21/dedup/oscar-000000000036.json.gz +3 -0
- 2021_21/dedup/oscar-000000000037.json.gz +3 -0
- 2021_21/dedup/oscar_2021_21_dedup.py +107 -0
- 2021_21/neardup/neardup_clean.py +107 -0
- 2021_21/neardup/oscar-neardup-000000000001.json.gz +3 -0
- 2021_21/neardup/oscar-neardup-000000000002.json.gz +3 -0
- 2021_21/neardup/oscar-neardup-000000000003.json.gz +3 -0
- 2021_21/neardup/oscar-neardup-000000000004.json.gz +3 -0
- 2021_21/neardup/oscar-neardup-000000000005.json.gz +3 -0
- 2021_21/neardup/oscar-neardup-000000000006.json.gz +3 -0
- 2021_21/neardup/oscar-neardup-000000000007.json.gz +3 -0
- 2021_21/neardup/oscar-neardup-000000000008.json.gz +3 -0
- 2021_21/neardup/oscar-neardup-000000000009.json.gz +3 -0
- 2021_21/neardup/oscar-neardup-000000000010.json.gz +3 -0
- 2021_21/neardup/oscar-neardup-000000000011.json.gz +3 -0
2021_21/dedup/oscar-000000000001.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e1b28acfb5d654febc3fa9b7aa3632e1313b56e98292f43168100aed5a4ec815
|
3 |
+
size 127341221
|
2021_21/dedup/oscar-000000000002.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:db88067e0690d3d9f5739b7320385d5998463dc038505494c518341a8abb4937
|
3 |
+
size 114794554
|
2021_21/dedup/oscar-000000000003.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9efd645bea40ca26fca065b6c3faf2a66bbf36e78b27a3481d4b4805088da2c7
|
3 |
+
size 125905990
|
2021_21/dedup/oscar-000000000004.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2961eab52a29516d3a409583dfe25bd369c59ec7cc412d07f4e297f16ba52b97
|
3 |
+
size 123673801
|
2021_21/dedup/oscar-000000000005.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b49877a6cdc55892c1787e43b0d231abe78e31aba546c82603e8a5161d26c6c0
|
3 |
+
size 121963107
|
2021_21/dedup/oscar-000000000006.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:975a0391414b7ddc3066775cad212e8e344e75ba19b4c102ed57d72f3c103d22
|
3 |
+
size 123823194
|
2021_21/dedup/oscar-000000000007.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c2c92182adc34ad1aebc6b86ecefaf62ed5bdd267ea342e2e9b371f5938e9846
|
3 |
+
size 115846564
|
2021_21/dedup/oscar-000000000008.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8bd38ee40eaee9f8a47874218fc840f522887c3899d8db6d232acf84b6db8305
|
3 |
+
size 129385817
|
2021_21/dedup/oscar-000000000009.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a4ba25334ca711a9b389546c8ec8fb7fd0656e28f7b553ebc3335fd22fb6a480
|
3 |
+
size 139806875
|
2021_21/dedup/oscar-000000000010.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:17b6f287d9be77a2c04635f821a97749e15b75e5176d2436f6833148a129c819
|
3 |
+
size 128359767
|
2021_21/dedup/oscar-000000000011.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1fcf062ef4f7a7f4b49109bc77d77c4c4de73d10fe471f370a280fee91919e3f
|
3 |
+
size 140066887
|
2021_21/dedup/oscar-000000000012.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6a446a7dcf13afa82a747fa8c7955cd2e811e307a7e44e53a3cee4e9f909f163
|
3 |
+
size 117413142
|
2021_21/dedup/oscar-000000000013.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d1d899a93a5993c67b799c92a9a68fe7a86b660686576f43d9496034f0651d59
|
3 |
+
size 120692690
|
2021_21/dedup/oscar-000000000014.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:47c0fe02d7aab14990b8242730ecb018df0c3fc3e9bd2a0fecce063f81cf5b1d
|
3 |
+
size 125459849
|
2021_21/dedup/oscar-000000000015.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ece2a8be708645743ca4fd06101f7c5efaf201257de8945641cbf08949397c4f
|
3 |
+
size 128480395
|
2021_21/dedup/oscar-000000000016.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c59d727da89a2f2d39b17cf28c12bd7e7be95d6440c15526db2519d27486dd4c
|
3 |
+
size 137127716
|
2021_21/dedup/oscar-000000000017.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:aab2071283eb23a9a1273b1bb698bc1bf49ae95296663c5448f47900b5e29c39
|
3 |
+
size 146653895
|
2021_21/dedup/oscar-000000000018.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9a977b9da02f427f24332112d3fc7873efc74e3130c80618cb3a7c9d8bc3f81e
|
3 |
+
size 139309680
|
2021_21/dedup/oscar-000000000019.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bfb6233bc64e3e4ad0bd4a08acf210f0888870f797e6bad6f13c351afae93886
|
3 |
+
size 126546858
|
2021_21/dedup/oscar-000000000020.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d4a7a59578d42dcb475fd38592ef3073cdc2b98daabdc71bea67df179787e69d
|
3 |
+
size 129634397
|
2021_21/dedup/oscar-000000000021.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:abe2a0448024172f04b1e53774c9aca192612773af2b3471b4afdba2b801f4f9
|
3 |
+
size 127733153
|
2021_21/dedup/oscar-000000000022.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:838a07a941079297c5f23f1844ff920ed426fcd24edb8515151d4771ddb1f021
|
3 |
+
size 130805886
|
2021_21/dedup/oscar-000000000023.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1f01327d095071ff57c04d32f4de6c1b0ea6394c9e2927aee3be808f09e9d86a
|
3 |
+
size 134503973
|
2021_21/dedup/oscar-000000000024.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d36ea0bd40b6767f9a0226b33da35308b57b960fd2c387464ef0e3a3f31da289
|
3 |
+
size 124606151
|
2021_21/dedup/oscar-000000000025.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a4b6bbdeb30b659f645be1727b4953cf08501ad9b8cf1db261b063e353dae0e7
|
3 |
+
size 130865974
|
2021_21/dedup/oscar-000000000026.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:df05b0dbcb9098325acfde40c62b6192a93a8442edab4c2b6e9936de606a844a
|
3 |
+
size 144162173
|
2021_21/dedup/oscar-000000000027.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1ff47653243f1ba57c6fe669a2a018f168ba10da4ced0a0afd1c2bdb29477ad2
|
3 |
+
size 139872728
|
2021_21/dedup/oscar-000000000028.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9a1255ea43326716412200f7d2b0245859641e00b7a88189f5f4782c330f5edd
|
3 |
+
size 132495352
|
2021_21/dedup/oscar-000000000029.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cf6518da32e5d2f607c6eb67266195bdc0cf8ac6cb37e1d6b37951d2c4569dd8
|
3 |
+
size 132911426
|
2021_21/dedup/oscar-000000000030.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e5b7eab138a9e4ab25a7ae83cd116d1af306cf9113da96d6d83fc912a745e2ea
|
3 |
+
size 144193824
|
2021_21/dedup/oscar-000000000031.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cc1bc59c605ea69c47fad86ad2b0e66211786c50bb82701c116388475fd3c3f1
|
3 |
+
size 146772212
|
2021_21/dedup/oscar-000000000032.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9050dde3ca70a275ddaa65b4273dd1aa8f0e2c2e2e0687daa7b98d884a50302f
|
3 |
+
size 142083208
|
2021_21/dedup/oscar-000000000033.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6e686a029d028e11db4725cbe5d040822e79f8c30ace90cc5c04ddcf52958123
|
3 |
+
size 139509825
|
2021_21/dedup/oscar-000000000034.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:490acbe46d4a6cf4e7fedd4ca4a73ee899b30d7b3eb96b06ffdccfd66fc39d7f
|
3 |
+
size 141932575
|
2021_21/dedup/oscar-000000000035.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e8ed8dde3d6b6b415f9da6826705850245d0429e247718b2f7b6ddb7b02e2938
|
3 |
+
size 137458511
|
2021_21/dedup/oscar-000000000036.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:64f49a127fe39111042571e35b13f76cdb28d297f438d2228843b41b65c9d8fd
|
3 |
+
size 127091100
|
2021_21/dedup/oscar-000000000037.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fdb1dc5806a3cadf0d3e120b30ae8c7803806a1414b54442426fbeeccead84dc
|
3 |
+
size 72094750
|
2021_21/dedup/oscar_2021_21_dedup.py
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
"""Cleaned Indonesian split of the mC4 corpus."""
|
16 |
+
import json
|
17 |
+
import glob
|
18 |
+
import gzip
|
19 |
+
import textwrap
|
20 |
+
import datasets
|
21 |
+
logger = datasets.logging.get_logger(__name__)
|
22 |
+
|
23 |
+
file = sorted(glob.glob('/data/oscar_2021_21_dedup/data/*'))
|
24 |
+
_CITATION = """
|
25 |
+
@article{JMLR:v21:20-074,
|
26 |
+
author = {Colin Raffel and Noam Shazeer and Adam Roberts and Katherine Lee and Sharan Narang and Michael Matena and Yanqi Zhou and Wei Li and Peter J. Liu},
|
27 |
+
title = {Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer},
|
28 |
+
journal = {Journal of Machine Learning Research},
|
29 |
+
year = {2020},
|
30 |
+
volume = {21},
|
31 |
+
number = {140},
|
32 |
+
pages = {1-67},
|
33 |
+
url = {http://jmlr.org/papers/v21/20-074.html}
|
34 |
+
}
|
35 |
+
"""
|
36 |
+
_DESCRIPTION = """\
|
37 |
+
A thoroughly cleaned version of the Italian portion of the multilingual
|
38 |
+
colossal, cleaned version of Common Crawl's web crawl corpus (mC4) by AllenAI.
|
39 |
+
Based on Common Crawl dataset: "https://commoncrawl.org".
|
40 |
+
This is the processed version of Google's mC4 dataset by AllenAI, with further cleaning
|
41 |
+
detailed in the repository README file.
|
42 |
+
"""
|
43 |
+
_HOMEPAGE = "https://github.com/allenai/allennlp/discussions/5056"
|
44 |
+
_LICENSE = "Open Data Commons Attribution License (ODC-By) v1.0"
|
45 |
+
_BASE_URL = "https://huggingface.co/datasets/munggok/mc4-id/resolve/main/mc4-id-filter/c4-id{split_suffix}.tfrecord-{index:05d}-of-{n_shards:05d}.json.gz"
|
46 |
+
_CONFIGS = {
|
47 |
+
"tiny": {"train": 100, "validation": 1},
|
48 |
+
"small": {"train": 250, "validation": 2},
|
49 |
+
"medium": {"train": 500, "validation": 4},
|
50 |
+
"large": {"train": 750, "validation": 6},
|
51 |
+
"full": {"train": 1016, "validation": 8}
|
52 |
+
}
|
53 |
+
class OscarConfig(datasets.BuilderConfig):
|
54 |
+
"""BuilderConfig for the Clean mC4 Italian."""
|
55 |
+
def __init__(self, **kwargs):
|
56 |
+
"""BuilderConfig for Clean mC4 Italian.
|
57 |
+
Args:
|
58 |
+
**kwargs: keyword arguments forwarded to super.
|
59 |
+
"""
|
60 |
+
super().__init__(**kwargs)
|
61 |
+
class Oscar(datasets.GeneratorBasedBuilder):
|
62 |
+
"""mC4, a colossal, cleaned version of Common Crawl's web crawl corpus."""
|
63 |
+
BUILDER_CONFIGS = [
|
64 |
+
OscarConfig(
|
65 |
+
name="full",
|
66 |
+
version=datasets.Version("1.0.0"),
|
67 |
+
description=textwrap.dedent(
|
68 |
+
f"""\
|
69 |
+
The full cleaned version of the Italian portion of the multilingual C4 corpus.
|
70 |
+
Estimated size of compressed files: 103GB
|
71 |
+
"""
|
72 |
+
)
|
73 |
+
)
|
74 |
+
]
|
75 |
+
def _info(self):
|
76 |
+
return datasets.DatasetInfo(
|
77 |
+
description=_DESCRIPTION,
|
78 |
+
features=datasets.Features(
|
79 |
+
{
|
80 |
+
"text": datasets.Value("string"),
|
81 |
+
"url": datasets.Value("string"),
|
82 |
+
"timestamp": datasets.Value("string"),
|
83 |
+
"meta": datasets.Value("string"),
|
84 |
+
}
|
85 |
+
),
|
86 |
+
supervised_keys=None,
|
87 |
+
homepage=_HOMEPAGE,
|
88 |
+
license=_LICENSE,
|
89 |
+
citation=_CITATION,
|
90 |
+
)
|
91 |
+
def _split_generators(self, dl_manager):
|
92 |
+
data_urls = {}
|
93 |
+
train_downloaded_files = file
|
94 |
+
return [
|
95 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepaths": train_downloaded_files}),
|
96 |
+
]
|
97 |
+
def _generate_examples(self, filepaths):
|
98 |
+
"""This function returns the examples in the raw (text) form by iterating on all the files."""
|
99 |
+
id_ = 0
|
100 |
+
for filepath in filepaths:
|
101 |
+
logger.info(f"Generating examples from {filepath}")
|
102 |
+
with gzip.open(open(filepath, "rb"), "rt", encoding="utf-8") as f:
|
103 |
+
for line in f:
|
104 |
+
if line:
|
105 |
+
example = json.loads(line)
|
106 |
+
yield id_, {'text':example['text'],'url':example['url'],'timestamp':example['timestamp'],'meta': example['meta']}
|
107 |
+
id_ += 1
|
2021_21/neardup/neardup_clean.py
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
"""Cleaned Indonesian split of the mC4 corpus."""
|
16 |
+
import json
|
17 |
+
import glob
|
18 |
+
import gzip
|
19 |
+
import textwrap
|
20 |
+
import datasets
|
21 |
+
logger = datasets.logging.get_logger(__name__)
|
22 |
+
|
23 |
+
file = sorted(glob.glob('/data/oscar_id/2021_21/neardup/*.gz'))
|
24 |
+
_CITATION = """
|
25 |
+
@article{JMLR:v21:20-074,
|
26 |
+
author = {Colin Raffel and Noam Shazeer and Adam Roberts and Katherine Lee and Sharan Narang and Michael Matena and Yanqi Zhou and Wei Li and Peter J. Liu},
|
27 |
+
title = {Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer},
|
28 |
+
journal = {Journal of Machine Learning Research},
|
29 |
+
year = {2020},
|
30 |
+
volume = {21},
|
31 |
+
number = {140},
|
32 |
+
pages = {1-67},
|
33 |
+
url = {http://jmlr.org/papers/v21/20-074.html}
|
34 |
+
}
|
35 |
+
"""
|
36 |
+
_DESCRIPTION = """\
|
37 |
+
A thoroughly cleaned version of the Italian portion of the multilingual
|
38 |
+
colossal, cleaned version of Common Crawl's web crawl corpus (mC4) by AllenAI.
|
39 |
+
Based on Common Crawl dataset: "https://commoncrawl.org".
|
40 |
+
This is the processed version of Google's mC4 dataset by AllenAI, with further cleaning
|
41 |
+
detailed in the repository README file.
|
42 |
+
"""
|
43 |
+
_HOMEPAGE = "https://github.com/allenai/allennlp/discussions/5056"
|
44 |
+
_LICENSE = "Open Data Commons Attribution License (ODC-By) v1.0"
|
45 |
+
_BASE_URL = "https://huggingface.co/datasets/munggok/mc4-id/resolve/main/mc4-id-filter/c4-id{split_suffix}.tfrecord-{index:05d}-of-{n_shards:05d}.json.gz"
|
46 |
+
_CONFIGS = {
|
47 |
+
"tiny": {"train": 100, "validation": 1},
|
48 |
+
"small": {"train": 250, "validation": 2},
|
49 |
+
"medium": {"train": 500, "validation": 4},
|
50 |
+
"large": {"train": 750, "validation": 6},
|
51 |
+
"full": {"train": 1016, "validation": 8}
|
52 |
+
}
|
53 |
+
class OscarConfig(datasets.BuilderConfig):
|
54 |
+
"""BuilderConfig for the Clean mC4 Italian."""
|
55 |
+
def __init__(self, **kwargs):
|
56 |
+
"""BuilderConfig for Clean mC4 Italian.
|
57 |
+
Args:
|
58 |
+
**kwargs: keyword arguments forwarded to super.
|
59 |
+
"""
|
60 |
+
super().__init__(**kwargs)
|
61 |
+
class Oscar(datasets.GeneratorBasedBuilder):
|
62 |
+
"""mC4, a colossal, cleaned version of Common Crawl's web crawl corpus."""
|
63 |
+
BUILDER_CONFIGS = [
|
64 |
+
OscarConfig(
|
65 |
+
name="full",
|
66 |
+
version=datasets.Version("1.0.0"),
|
67 |
+
description=textwrap.dedent(
|
68 |
+
f"""\
|
69 |
+
The full cleaned version of the Italian portion of the multilingual C4 corpus.
|
70 |
+
Estimated size of compressed files: 103GB
|
71 |
+
"""
|
72 |
+
)
|
73 |
+
)
|
74 |
+
]
|
75 |
+
def _info(self):
|
76 |
+
return datasets.DatasetInfo(
|
77 |
+
description=_DESCRIPTION,
|
78 |
+
features=datasets.Features(
|
79 |
+
{
|
80 |
+
"text": datasets.Value("string"),
|
81 |
+
"url": datasets.Value("string"),
|
82 |
+
"timestamp": datasets.Value("string"),
|
83 |
+
"meta": datasets.Value("string"),
|
84 |
+
}
|
85 |
+
),
|
86 |
+
supervised_keys=None,
|
87 |
+
homepage=_HOMEPAGE,
|
88 |
+
license=_LICENSE,
|
89 |
+
citation=_CITATION,
|
90 |
+
)
|
91 |
+
def _split_generators(self, dl_manager):
|
92 |
+
data_urls = {}
|
93 |
+
train_downloaded_files = file
|
94 |
+
return [
|
95 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepaths": train_downloaded_files}),
|
96 |
+
]
|
97 |
+
def _generate_examples(self, filepaths):
|
98 |
+
"""This function returns the examples in the raw (text) form by iterating on all the files."""
|
99 |
+
id_ = 0
|
100 |
+
for filepath in filepaths:
|
101 |
+
logger.info(f"Generating examples from {filepath}")
|
102 |
+
with gzip.open(open(filepath, "rb"), "rt", encoding="utf-8") as f:
|
103 |
+
for line in f:
|
104 |
+
if line:
|
105 |
+
example = json.loads(line)
|
106 |
+
yield id_, {'text':example['text'],'url':example['url'],'timestamp':example['timestamp'],'meta': example['meta']}
|
107 |
+
id_ += 1
|
2021_21/neardup/oscar-neardup-000000000001.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:12aca138a0c6f76a5d3c4a673ad317704598ba10baa9b61dc6276147f36847ce
|
3 |
+
size 126507303
|
2021_21/neardup/oscar-neardup-000000000002.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9504c1ea60a2bb67f3431083c7387d27ee62b5fa234aa7f3a96c333e125c52b9
|
3 |
+
size 116921271
|
2021_21/neardup/oscar-neardup-000000000003.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4150058257f8630d4a75fd1bf8e5dd6dba6db950e576c40970ffe6ae79e4489c
|
3 |
+
size 127888528
|
2021_21/neardup/oscar-neardup-000000000004.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2e4e4e45b17c9b7652dbae65ba1454e59432db66bd864fa3ece212c080b49df3
|
3 |
+
size 118308580
|
2021_21/neardup/oscar-neardup-000000000005.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9d44d9efe3cad48090c17a9a1ef766f4c32da85dcb4b2f359c2a362170bf9810
|
3 |
+
size 126388537
|
2021_21/neardup/oscar-neardup-000000000006.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9b2f33de47b4dccaa5121426195db179996fa7e1c90222e462f5ea8447721c7b
|
3 |
+
size 116098988
|
2021_21/neardup/oscar-neardup-000000000007.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4577e998d9072f5e909fc390edb56b24be001f8844982498e4576aff7b7252d6
|
3 |
+
size 130372693
|
2021_21/neardup/oscar-neardup-000000000008.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0e86ab14e3cbb212972023917e21e8824013afded874f698ec0e6fac62b448b0
|
3 |
+
size 137529281
|
2021_21/neardup/oscar-neardup-000000000009.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:66673dbba3fcaea94d43a2628a5a781c47ae3346c0004e406f1977116b6bbece
|
3 |
+
size 133411496
|
2021_21/neardup/oscar-neardup-000000000010.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c034dfd11e8086a63384e2ce62fdf9f53f6a484c6ed9ec17164b12e0eae5cab1
|
3 |
+
size 129863712
|
2021_21/neardup/oscar-neardup-000000000011.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ca563775ccdd75927644d970dc3c1dfdbbefe1b46aa4b31f2c00b80b428dea1f
|
3 |
+
size 118943987
|