feat: add checksums
Browse files
2021-punctuation-restoration.py
CHANGED
@@ -17,10 +17,12 @@ _HOMEPAGE = "https://github.com/poleval/2021-punctuation-restoration"
|
|
17 |
_URL = "https://raw.githubusercontent.com/poleval/2021-punctuation-restoration/main"
|
18 |
|
19 |
_PATHS = {
|
20 |
-
"train": os.path.join(_URL, "train"),
|
21 |
-
"test-A": os.path.join(_URL, "test-A"),
|
22 |
}
|
23 |
|
|
|
|
|
24 |
|
25 |
class PunctuationDatasetConfig(datasets.BuilderConfig):
|
26 |
"""BuilderConfig for AfrikaansNerCorpus"""
|
@@ -75,19 +77,20 @@ class PunctuationDataset(datasets.GeneratorBasedBuilder):
|
|
75 |
)
|
76 |
|
77 |
def _split_generators(self, dl_manager):
|
|
|
|
|
78 |
return [
|
79 |
datasets.SplitGenerator(
|
80 |
-
name=datasets.Split.TRAIN, gen_kwargs={"
|
81 |
),
|
82 |
datasets.SplitGenerator(
|
83 |
-
name=datasets.Split.TEST, gen_kwargs={"
|
84 |
),
|
85 |
]
|
86 |
|
87 |
-
def _generate_examples(self,
|
88 |
-
in_df = pd.read_csv(os.path.join(
|
89 |
-
out_df = pd.read_csv(os.path.join(
|
90 |
-
|
91 |
for key, ((_, row_in), (_, row_out)) in enumerate(zip(in_df.iterrows(), out_df.iterrows()), 1):
|
92 |
|
93 |
text_in = PunctuationDataset._clean_text(row_in[1])
|
|
|
17 |
_URL = "https://raw.githubusercontent.com/poleval/2021-punctuation-restoration/main"
|
18 |
|
19 |
_PATHS = {
|
20 |
+
"train": [os.path.join(_URL, "train", "in.tsv"), os.path.join(_URL, "train", "expected.tsv")],
|
21 |
+
"test-A": [os.path.join(_URL, "test-A", "in.tsv"), os.path.join(_URL, "test-A", "expected.tsv")],
|
22 |
}
|
23 |
|
24 |
+
_TO_DOWNLOAD = _PATHS["train"] + _PATHS["test-A"]
|
25 |
+
|
26 |
|
27 |
class PunctuationDatasetConfig(datasets.BuilderConfig):
|
28 |
"""BuilderConfig for AfrikaansNerCorpus"""
|
|
|
77 |
)
|
78 |
|
79 |
def _split_generators(self, dl_manager):
|
80 |
+
data_paths = {key: dl_manager.download(urls) for key, urls in _PATHS.items()}
|
81 |
+
print(data_paths)
|
82 |
return [
|
83 |
datasets.SplitGenerator(
|
84 |
+
name=datasets.Split.TRAIN, gen_kwargs={"filepaths": data_paths["train"]}
|
85 |
),
|
86 |
datasets.SplitGenerator(
|
87 |
+
name=datasets.Split.TEST, gen_kwargs={"filepaths": data_paths["test-A"]}
|
88 |
),
|
89 |
]
|
90 |
|
91 |
+
def _generate_examples(self, filepaths):
|
92 |
+
in_df = pd.read_csv(os.path.join(filepaths[0]), sep='\t', header=None)
|
93 |
+
out_df = pd.read_csv(os.path.join(filepaths[1]), sep='\t', header=None)
|
|
|
94 |
for key, ((_, row_in), (_, row_out)) in enumerate(zip(in_df.iterrows(), out_df.iterrows()), 1):
|
95 |
|
96 |
text_in = PunctuationDataset._clean_text(row_in[1])
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"punctuation_dataset": {"description": "This dataset is designed to be used in training models\nthat restore punctuation marks from the output of \nAutomatic Speech Recognition system for Polish language.\n", "citation": "", "homepage": "https://github.com/poleval/2021-punctuation-restoration", "license": "", "features": {"text_in": {"dtype": "string", "id": null, "_type": "Value"}, "text_out": {"dtype": "string", "id": null, "_type": "Value"}, "tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "tags": {"feature": {"num_classes": 8, "names": ["B-.", "B-,", "B--", "B-!", "B-?", "B-:", "B-;", "O"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "punctuation_dataset", "config_name": "punctuation_dataset", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 5397192, "num_examples": 800, "dataset_name": "punctuation_dataset"}, "test": {"name": "test", "num_bytes": 1343742, "num_examples": 200, "dataset_name": "punctuation_dataset"}}, "download_checksums": {"https://raw.githubusercontent.com/poleval/2021-punctuation-restoration/main/train/in.tsv": {"num_bytes": 1194117, "checksum": "5d6f6f0877b015afd88b04096879aa85d1a9e3fa52427b545258b2ef4d4cdb6e"}, "https://raw.githubusercontent.com/poleval/2021-punctuation-restoration/main/train/expected.tsv": {"num_bytes": 1206847, "checksum": "246d79bb9fc1411e658d1c80299c0e2d8e9ad6c05b2e95d553a529ea96d4dedd"}, "https://raw.githubusercontent.com/poleval/2021-punctuation-restoration/main/test-A/in.tsv": {"num_bytes": 298329, "checksum": "a41dc55aef0ced62d5c1c43495150a6762d6b52e6261f952d13cd80bfbf1373b"}, "https://raw.githubusercontent.com/poleval/2021-punctuation-restoration/main/test-A/expected.tsv": {"num_bytes": 301479, "checksum": "67537e5ee05b9c3a3a7282fa7b8754f4777a9dcfb3d179cc478c2416c98abfd0"}}, "download_size": 3000772, "post_processing_size": null, "dataset_size": 6740934, "size_in_bytes": 9741706}}
|
dummy/punctuation_dataset/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d869309ed3c1969408e7816abf58d3181f005b94177060a3555ef0390c4f073f
|
3 |
+
size 8568
|