Commit
•
e993ccf
1
Parent(s):
f5bf74a
Update parquet files
Browse files- .gitattributes +1 -0
- iceErrorCorpus.py +0 -121
- iceErrorCorpus/ice_error_corpus-test.parquet +0 -0
- test.tsv → iceErrorCorpus/ice_error_corpus-train.parquet +2 -2
- iceErrorCorpus/ice_error_corpus-validation.parquet +0 -0
- train.tsv +0 -3
- valid.tsv +0 -3
.gitattributes
CHANGED
@@ -6,3 +6,4 @@ valid.tsv filter=lfs diff=lfs merge=lfs -text
|
|
6 |
test.csv filter=lfs diff=lfs merge=lfs -text
|
7 |
train.csv filter=lfs diff=lfs merge=lfs -text
|
8 |
valid.csv filter=lfs diff=lfs merge=lfs -text
|
|
|
|
6 |
test.csv filter=lfs diff=lfs merge=lfs -text
|
7 |
train.csv filter=lfs diff=lfs merge=lfs -text
|
8 |
valid.csv filter=lfs diff=lfs merge=lfs -text
|
9 |
+
iceErrorCorpus/ice_error_corpus-train.parquet filter=lfs diff=lfs merge=lfs -text
|
iceErrorCorpus.py
DELETED
@@ -1,121 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
import csv
|
3 |
-
import json
|
4 |
-
import os
|
5 |
-
from typing import List
|
6 |
-
import datasets
|
7 |
-
|
8 |
-
|
9 |
-
_DESCRIPTION = """\
|
10 |
-
Icelandic GEC corpus.
|
11 |
-
|
12 |
-
The Icelandic Error Corpus (IceEC) is a collection of texts in modern Icelandic annotated for mistakes related to spelling, grammar, and other issues. The texts are organized by genre, if which there are three: student essays, online news texts and Icelandic Wikipedia articles. Each mistake is marked according to error type using an error code, of which there are 253. The corpus consists of 4,046 texts with 56,956 categorized error instances. The corpus is divided into a development corpus, which comprises 90% of the corpus, and a test corpus, which comprises the other 10% of the corpus.
|
13 |
-
"""
|
14 |
-
|
15 |
-
_HOMEPAGE = "https://repository.clarin.is/repository/xmlui/handle/20.500.12537/105"
|
16 |
-
|
17 |
-
_CITATION = """
|
18 |
-
@misc{20.500.12537/105,
|
19 |
-
title = {Icelandic Error Corpus ({IceEC}) Version 1.1},
|
20 |
-
author = {Ingason, Anton Karl and Stef{\'a}nsd{\'o}ttir, Lilja Bj{\"o}rk and Arnard{\'o}ttir, {\TH}{\'o}runn and Xu, Xindan},
|
21 |
-
url = {http://hdl.handle.net/20.500.12537/105},
|
22 |
-
note = {{CLARIN}-{IS}},
|
23 |
-
copyright = {Creative Commons - Attribution 4.0 International ({CC} {BY} 4.0)},
|
24 |
-
year = {2021} }
|
25 |
-
"""
|
26 |
-
|
27 |
-
_LICENSE = "CC BY 4.0"
|
28 |
-
|
29 |
-
_URLS = {
|
30 |
-
"train": "train.tsv",
|
31 |
-
"dev": "valid.tsv",
|
32 |
-
"test": "test.tsv",
|
33 |
-
|
34 |
-
}
|
35 |
-
|
36 |
-
class iceErrorCorpus(datasets.GeneratorBasedBuilder):
|
37 |
-
"""TODO: Short description of my dataset."""
|
38 |
-
|
39 |
-
VERSION = datasets.Version("1.0.0")
|
40 |
-
|
41 |
-
BUILDER_CONFIGS = [
|
42 |
-
datasets.BuilderConfig(
|
43 |
-
name="iceErrorCorpus", version=VERSION, description="Icelandic GEC corpus"
|
44 |
-
),
|
45 |
-
]
|
46 |
-
|
47 |
-
DEFAULT_CONFIG_NAME = "iceErrorCorpus"
|
48 |
-
|
49 |
-
def _info(self):
|
50 |
-
if self.config.name == "iceErrorCorpus":
|
51 |
-
features = datasets.Features(
|
52 |
-
{
|
53 |
-
"src": datasets.Value("string"),
|
54 |
-
"tgt": datasets.Value("string"),
|
55 |
-
}
|
56 |
-
)
|
57 |
-
|
58 |
-
return datasets.DatasetInfo(
|
59 |
-
# This is the description that will appear on the datasets page.
|
60 |
-
description=_DESCRIPTION,
|
61 |
-
# This defines the different columns of the dataset and their types
|
62 |
-
features=features, # Here we define them above because they are different between the two configurations
|
63 |
-
# If there's a common (input, target) tuple from the features,
|
64 |
-
# specify them here. They'll be used if as_supervised=True in
|
65 |
-
# builder.as_dataset.
|
66 |
-
supervised_keys=None,
|
67 |
-
# Homepage of the dataset for documentation
|
68 |
-
homepage=_HOMEPAGE,
|
69 |
-
# License for the dataset if available
|
70 |
-
license=_LICENSE,
|
71 |
-
# Citation for the dataset
|
72 |
-
citation=_CITATION,
|
73 |
-
)
|
74 |
-
|
75 |
-
def _split_generators(self, dl_manager):
|
76 |
-
"""Returns SplitGenerators."""
|
77 |
-
data_dir = dl_manager.download_and_extract(_URLS)
|
78 |
-
return [
|
79 |
-
datasets.SplitGenerator(
|
80 |
-
name=datasets.Split.TRAIN,
|
81 |
-
# These kwargs will be passed to _generate_examples
|
82 |
-
gen_kwargs={
|
83 |
-
"filepath": data_dir["train"],
|
84 |
-
"split": "train",
|
85 |
-
},
|
86 |
-
),
|
87 |
-
datasets.SplitGenerator(
|
88 |
-
name=datasets.Split.TEST,
|
89 |
-
# These kwargs will be passed to _generate_examples
|
90 |
-
gen_kwargs={
|
91 |
-
"filepath": data_dir["test"],
|
92 |
-
"split": "test"
|
93 |
-
},
|
94 |
-
),
|
95 |
-
datasets.SplitGenerator(
|
96 |
-
name=datasets.Split.VALIDATION,
|
97 |
-
# These kwargs will be passed to _generate_examples
|
98 |
-
gen_kwargs={
|
99 |
-
"filepath": data_dir["dev"],
|
100 |
-
"split": "dev",
|
101 |
-
},
|
102 |
-
),
|
103 |
-
]
|
104 |
-
|
105 |
-
def _generate_examples(
|
106 |
-
self, filepath, split # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
107 |
-
):
|
108 |
-
""" Yields examples as (key, example) tuples. """
|
109 |
-
# This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
110 |
-
# The `key` is here for legacy reason (tfds) and is not important in itself.
|
111 |
-
|
112 |
-
with open(filepath, encoding="utf-8") as f:
|
113 |
-
key = 0
|
114 |
-
tsv_f = csv.reader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
|
115 |
-
for row in tsv_f:
|
116 |
-
if self.config.name == "iceErrorCorpus":
|
117 |
-
yield key, {
|
118 |
-
"src": row[0],
|
119 |
-
"tgt": row[1],
|
120 |
-
}
|
121 |
-
key += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
iceErrorCorpus/ice_error_corpus-test.parquet
ADDED
Binary file (847 kB). View file
|
|
test.tsv → iceErrorCorpus/ice_error_corpus-train.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4e6bf636ac138999a6ee46506aaa30c0fa797f327230ab2ed98eca563c893690
|
3 |
+
size 8729149
|
iceErrorCorpus/ice_error_corpus-validation.parquet
ADDED
Binary file (885 kB). View file
|
|
train.tsv
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:d40f1eac27b678ab7343435e8627b64f3c5fa6c554f7d38329f931cea7a5217f
|
3 |
-
size 13002995
|
|
|
|
|
|
|
|
valid.tsv
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:356ba143f0c44743fb0d3f313e2b36112b831840060ee4606f7629c4b4da3544
|
3 |
-
size 1217070
|
|
|
|
|
|
|
|