Datasets:
Commit
•
d37aaca
1
Parent(s):
8f8ffe5
Delete loading script
Browse files
cawac.py
DELETED
@@ -1,91 +0,0 @@
|
|
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 |
-
"""caWaC: Catalan web corpus dataset."""
|
16 |
-
|
17 |
-
import datasets
|
18 |
-
|
19 |
-
|
20 |
-
_CITATION = """\
|
21 |
-
@inproceedings{DBLP:conf/lrec/LjubesicT14,
|
22 |
-
author = {Nikola Ljubesic and
|
23 |
-
Antonio Toral},
|
24 |
-
editor = {Nicoletta Calzolari and
|
25 |
-
Khalid Choukri and
|
26 |
-
Thierry Declerck and
|
27 |
-
Hrafn Loftsson and
|
28 |
-
Bente Maegaard and
|
29 |
-
Joseph Mariani and
|
30 |
-
Asunci{\'{o}}n Moreno and
|
31 |
-
Jan Odijk and
|
32 |
-
Stelios Piperidis},
|
33 |
-
title = {caWaC - {A} web corpus of Catalan and its application to language
|
34 |
-
modeling and machine translation},
|
35 |
-
booktitle = {Proceedings of the Ninth International Conference on Language Resources
|
36 |
-
and Evaluation, {LREC} 2014, Reykjavik, Iceland, May 26-31, 2014},
|
37 |
-
pages = {1728--1732},
|
38 |
-
publisher = {European Language Resources Association {(ELRA)}},
|
39 |
-
year = {2014},
|
40 |
-
url = {http://www.lrec-conf.org/proceedings/lrec2014/summaries/841.html},
|
41 |
-
timestamp = {Mon, 19 Aug 2019 15:23:35 +0200},
|
42 |
-
biburl = {https://dblp.org/rec/conf/lrec/LjubesicT14.bib},
|
43 |
-
bibsource = {dblp computer science bibliography, https://dblp.org}
|
44 |
-
}
|
45 |
-
"""
|
46 |
-
|
47 |
-
_DESCRIPTION = """\
|
48 |
-
caWaC is a 780-million-token web corpus of Catalan built from the .cat top-level-domain in late 2013.
|
49 |
-
"""
|
50 |
-
|
51 |
-
_LICENSE = "CC BY-SA 3.0"
|
52 |
-
|
53 |
-
_HOMEPAGE = "http://nlp.ffzg.hr/resources/corpora/cawac/"
|
54 |
-
# Source: http://nlp.ffzg.hr/data/corpora/cawac.uniq.sortr.gz
|
55 |
-
_URLS = "data/cawac.uniq.sortr.gz"
|
56 |
-
|
57 |
-
|
58 |
-
class Cawac(datasets.GeneratorBasedBuilder):
|
59 |
-
"""caWaC: Catalan web corpus dataset."""
|
60 |
-
|
61 |
-
def _info(self):
|
62 |
-
return datasets.DatasetInfo(
|
63 |
-
description=_DESCRIPTION,
|
64 |
-
features=datasets.Features(
|
65 |
-
{
|
66 |
-
"sentence": datasets.Value("string"),
|
67 |
-
}
|
68 |
-
),
|
69 |
-
supervised_keys=None,
|
70 |
-
homepage=_HOMEPAGE,
|
71 |
-
license=_LICENSE,
|
72 |
-
citation=_CITATION,
|
73 |
-
)
|
74 |
-
|
75 |
-
def _split_generators(self, dl_manager):
|
76 |
-
downloaded_file = dl_manager.download_and_extract(_URLS)
|
77 |
-
return [
|
78 |
-
datasets.SplitGenerator(
|
79 |
-
name=datasets.Split.TRAIN,
|
80 |
-
gen_kwargs={
|
81 |
-
"filepath": downloaded_file,
|
82 |
-
},
|
83 |
-
),
|
84 |
-
]
|
85 |
-
|
86 |
-
def _generate_examples(self, filepath):
|
87 |
-
with open(filepath, encoding="utf8") as f:
|
88 |
-
for id_, row in enumerate(f):
|
89 |
-
yield id_, {
|
90 |
-
"sentence": row,
|
91 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|