Datasets:

Modalities:
Text
Formats:
parquet
Languages:
Catalan
Libraries:
Datasets
Dask
License:
Blanca commited on
Commit
cae5051
·
1 Parent(s): 4b3ca94

Upload 2 files

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. raco_forums_corpus.py +75 -0
  3. valid.txt +3 -0
.gitattributes CHANGED
@@ -49,3 +49,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
49
  *.jpg filter=lfs diff=lfs merge=lfs -text
50
  *.jpeg filter=lfs diff=lfs merge=lfs -text
51
  *.webp filter=lfs diff=lfs merge=lfs -text
 
 
49
  *.jpg filter=lfs diff=lfs merge=lfs -text
50
  *.jpeg filter=lfs diff=lfs merge=lfs -text
51
  *.webp filter=lfs diff=lfs merge=lfs -text
52
+ valid.txt filter=lfs diff=lfs merge=lfs -text
raco_forums_corpus.py ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """Racó Forums Corpus"""
16
+
17
+ import os
18
+
19
+ import datasets
20
+
21
+
22
+ _CITATION = """
23
+ """
24
+
25
+ _DESCRIPTION = """\
26
+ The Racó Forums Corpus is a 19,205,185-million-sentence corpus of Catalan user-generated text built from the forums of Racó Català.
27
+
28
+ Since the existing available corpora in Catalan lacked conversational data, we searched for a major source of such data for Catalan, and we found Racó Català, a popular multitopic online forum. We obtained a database dump and we transformed all the threads so that we obtained documents that traversed all the existing paths from the root (initial comment) to the leaves (last comment with no reply). In other words, if T is a tree such that T = {A,B,C,D} and the first comment is A that is replied by B and C independently, and, then, C is replied by D, we obtain two different documents A,B and A,C,D in the fairseq language modeling format.
29
+ """
30
+
31
+ _HOMEPAGE = "https://www.racocatala.cat/forums"
32
+
33
+ _LICENSE = "Creative Commons Non-commercial 4.0 International"
34
+
35
+ _URL = "./"
36
+ _TRAINING_FILE = "train.txt"
37
+ _DEV_FILE = "valid.txt"
38
+
39
+
40
+ class RacoForumsCorpus(datasets.GeneratorBasedBuilder):
41
+ """Racó Forums Corpus"""
42
+
43
+ VERSION = datasets.Version("1.0.0")
44
+
45
+ def _info(self):
46
+ return datasets.DatasetInfo(
47
+ description=_DESCRIPTION,
48
+ features=datasets.Features({"text": datasets.Value("string")}),
49
+ supervised_keys=None,
50
+ homepage=_HOMEPAGE,
51
+ license=_LICENSE,
52
+ citation=_CITATION,
53
+ )
54
+
55
+ def _split_generators(self, dl_manager):
56
+ urls_to_download = {
57
+ "train": f"{_URL}{_TRAINING_FILE}",
58
+ "dev": f"{_URL}{_DEV_FILE}",
59
+ }
60
+ downloaded_files = dl_manager.download_and_extract(urls_to_download)
61
+ return [
62
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
63
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
64
+ ]
65
+
66
+
67
+ def _generate_examples(self, filepath):
68
+ with open(filepath, encoding="utf-8") as f:
69
+ text = ""
70
+ for id_, line in enumerate(f):
71
+ if line == "\n":
72
+ yield id_, {"text": text.strip()}
73
+ text = ""
74
+ else:
75
+ text += line
valid.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d66ede4e0e9983d4b1d27b02473257b0f1f7297a3f1377667aebcf8ecb4e6db7
3
+ size 21471977