Datasets:
parquet-converter
commited on
Commit
•
3eff345
1
Parent(s):
0f614d8
Update parquet files
Browse files- .gitattributes +0 -28
- README.md +0 -27
- italian.jsonl → aseifert--merlin/json-train.parquet +2 -2
- czech.jsonl +0 -3
- german.jsonl +0 -3
- load_dataset_merlin.ipynb +0 -142
.gitattributes
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
-
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
-
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
28 |
-
*.jsonl filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
---
|
2 |
-
annotations_creators: []
|
3 |
-
language_creators: []
|
4 |
-
language:
|
5 |
-
- cz
|
6 |
-
- de
|
7 |
-
- it
|
8 |
-
license: []
|
9 |
-
multilinguality:
|
10 |
-
- translation
|
11 |
-
pretty_name: merlin
|
12 |
-
size_categories:
|
13 |
-
- unknown
|
14 |
-
source_datasets: []
|
15 |
-
task_categories:
|
16 |
-
- conditional-text-generation
|
17 |
-
task_ids:
|
18 |
-
- machine-translation
|
19 |
-
---
|
20 |
-
|
21 |
-
# MERLIN corpus
|
22 |
-
|
23 |
-
Project URL: https://merlin-platform.eu/C_mcorpus.php
|
24 |
-
|
25 |
-
Dataset URL: https://clarin.eurac.edu/repository/xmlui/handle/20.500.12124/6
|
26 |
-
|
27 |
-
The MERLIN corpus is a written learner corpus for Czech, German, and Italian that has been designed to illustrate the Common European Framework of Reference for Languages (CEFR) with authentic learner data. The corpus contains learner texts produced in standardized language certifications covering CEFR levels A1-C1. The MERLIN annotation scheme includes a wide range of language characteristics that provide researchers with concrete examples of learner performance and progress across multiple proficiency levels.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
italian.jsonl → aseifert--merlin/json-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:7cb8b7fba0e875a8757f6cf5c9af2dc977baf65c762a3ebb2065dcac0b72c423
|
3 |
+
size 2455173
|
czech.jsonl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:5861686c3d04f4c59824de6bb2909dd783643a7cdefb7f0aefa4f51d282ab8a8
|
3 |
-
size 1501122
|
|
|
|
|
|
|
|
german.jsonl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:aa213367d44e61467b56fa72c8a921e3b02187dc8dd205766e8fcb30caed4547
|
3 |
-
size 2323851
|
|
|
|
|
|
|
|
load_dataset_merlin.ipynb
DELETED
@@ -1,142 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"cells": [
|
3 |
-
{
|
4 |
-
"cell_type": "code",
|
5 |
-
"execution_count": null,
|
6 |
-
"id": "7301572a-4803-4a16-b262-74e41e25803e",
|
7 |
-
"metadata": {},
|
8 |
-
"outputs": [],
|
9 |
-
"source": [
|
10 |
-
"from pathlib import Path\n",
|
11 |
-
"\n",
|
12 |
-
"import pandas as pd\n",
|
13 |
-
"from datasets import Dataset, DatasetDict, load_dataset\n",
|
14 |
-
"from huggingface_hub import Repository, create_repo\n",
|
15 |
-
"from selectolax.parser import HTMLParser"
|
16 |
-
]
|
17 |
-
},
|
18 |
-
{
|
19 |
-
"cell_type": "code",
|
20 |
-
"execution_count": null,
|
21 |
-
"id": "a898baed-3640-4ca8-9d3d-b88f6c85a428",
|
22 |
-
"metadata": {},
|
23 |
-
"outputs": [],
|
24 |
-
"source": [
|
25 |
-
"def _parse_start_end(node):\n",
|
26 |
-
" return int(node.attrs[\"start\"][1:]), int(node.attrs[\"end\"][1:])\n",
|
27 |
-
"\n",
|
28 |
-
"\n",
|
29 |
-
"def get_original_text(sent_toks) -> str:\n",
|
30 |
-
" empty_tokens = [i for i, t in enumerate(sent_toks) if not t.text().strip()]\n",
|
31 |
-
" org_sent_toks = [t.text() for i, t in enumerate(sent_toks) if not i in empty_tokens]\n",
|
32 |
-
" return \" \".join(org_sent_toks)\n",
|
33 |
-
"\n",
|
34 |
-
"\n",
|
35 |
-
"def get_corrected_text(toks_cor, last_end, sent_end) -> str:\n",
|
36 |
-
" cor_toks = []\n",
|
37 |
-
" for tok in toks_cor:\n",
|
38 |
-
" tok_start, tok_end = _parse_start_end(tok)\n",
|
39 |
-
" if tok_start >= last_end and tok_end <= sent_end:\n",
|
40 |
-
" cor_toks.append(tok.text())\n",
|
41 |
-
" last_end = tok_end\n",
|
42 |
-
" return last_end, \" \".join(cor_toks)\n",
|
43 |
-
"\n",
|
44 |
-
"\n",
|
45 |
-
"def process_doc(doc, path):\n",
|
46 |
-
" toks = doc.select('tier[category=\"tok\"] event').matches\n",
|
47 |
-
" toks_cor = doc.select('tier[category=\"TH1\"] event').matches\n",
|
48 |
-
" sents = doc.select('tier[category=\"sentence\"] event').matches\n",
|
49 |
-
"\n",
|
50 |
-
" last_end = 0\n",
|
51 |
-
" for sent_no, org_sent in enumerate(sents):\n",
|
52 |
-
" sent_start, sent_end = _parse_start_end(org_sent)\n",
|
53 |
-
" sent_toks = toks[sent_start:sent_end]\n",
|
54 |
-
" original_text = get_original_text(sent_toks)\n",
|
55 |
-
" last_end, corrected_text = get_corrected_text(toks_cor, last_end, sent_end)\n",
|
56 |
-
"\n",
|
57 |
-
" yield (\n",
|
58 |
-
" {\n",
|
59 |
-
" \"original\": original_text,\n",
|
60 |
-
" \"corrected\": corrected_text,\n",
|
61 |
-
" \"id\": f\"{path.stem}-{sent_no}\",\n",
|
62 |
-
" }\n",
|
63 |
-
" )"
|
64 |
-
]
|
65 |
-
},
|
66 |
-
{
|
67 |
-
"cell_type": "code",
|
68 |
-
"execution_count": null,
|
69 |
-
"id": "191fe2e3-8a4e-47e2-9316-5b6028662c02",
|
70 |
-
"metadata": {},
|
71 |
-
"outputs": [],
|
72 |
-
"source": [
|
73 |
-
"DATASET_NAME = \"merlin\"\n",
|
74 |
-
"dataset_path = Path.home() / DATASET_NAME\n",
|
75 |
-
"if not Path(dataset_path).exists():\n",
|
76 |
-
" repo_url = create_repo(name=DATASET_NAME, repo_type=\"dataset\")\n",
|
77 |
-
" repo = Repository(local_dir=str(dataset_path), clone_from=repo_url)\n",
|
78 |
-
" repo.lfs_track(\"*.jsonl\")"
|
79 |
-
]
|
80 |
-
},
|
81 |
-
{
|
82 |
-
"cell_type": "code",
|
83 |
-
"execution_count": null,
|
84 |
-
"id": "005d059f-5de4-4f14-bde3-0cc9ff2435c0",
|
85 |
-
"metadata": {},
|
86 |
-
"outputs": [],
|
87 |
-
"source": [
|
88 |
-
"MERLN_EXMARALDA_BASE = Path.home() / Path(\n",
|
89 |
-
" \"Downloads/MERLIN Written Learner Corpus for Czech, German, Italian 1.1/merlin-exmaralda-v1.1/\"\n",
|
90 |
-
")\n",
|
91 |
-
"\n",
|
92 |
-
"for lang in (\"german\", \"czech\", \"italian\"):\n",
|
93 |
-
" lang_docs = []\n",
|
94 |
-
" for path in (MERLN_EXMARALDA_BASE / lang).glob(\"*.exb\"):\n",
|
95 |
-
" with open(path) as fp:\n",
|
96 |
-
" xml = HTMLParser(fp.read())\n",
|
97 |
-
" docs = list(process_doc(xml, path))\n",
|
98 |
-
" lang_docs.extend(docs)\n",
|
99 |
-
" Dataset.from_dict(pd.DataFrame(lang_docs)).to_json(dataset_path / f\"{lang}.jsonl\")"
|
100 |
-
]
|
101 |
-
},
|
102 |
-
{
|
103 |
-
"cell_type": "code",
|
104 |
-
"execution_count": null,
|
105 |
-
"id": "f9d396b2-98dc-4c04-950f-0332a3a6d751",
|
106 |
-
"metadata": {},
|
107 |
-
"outputs": [],
|
108 |
-
"source": [
|
109 |
-
"repo.push_to_hub()"
|
110 |
-
]
|
111 |
-
},
|
112 |
-
{
|
113 |
-
"cell_type": "code",
|
114 |
-
"execution_count": null,
|
115 |
-
"id": "91377eaf-ffac-4df0-9c85-4f6ee979f99f",
|
116 |
-
"metadata": {},
|
117 |
-
"outputs": [],
|
118 |
-
"source": []
|
119 |
-
}
|
120 |
-
],
|
121 |
-
"metadata": {
|
122 |
-
"kernelspec": {
|
123 |
-
"display_name": "Python 3 (ipykernel)",
|
124 |
-
"language": "python",
|
125 |
-
"name": "python3"
|
126 |
-
},
|
127 |
-
"language_info": {
|
128 |
-
"codemirror_mode": {
|
129 |
-
"name": "ipython",
|
130 |
-
"version": 3
|
131 |
-
},
|
132 |
-
"file_extension": ".py",
|
133 |
-
"mimetype": "text/x-python",
|
134 |
-
"name": "python",
|
135 |
-
"nbconvert_exporter": "python",
|
136 |
-
"pygments_lexer": "ipython3",
|
137 |
-
"version": "3.9.7"
|
138 |
-
}
|
139 |
-
},
|
140 |
-
"nbformat": 4,
|
141 |
-
"nbformat_minor": 5
|
142 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|