Matej U
commited on
Commit
•
ae7bfe4
1
Parent(s):
b1d7d9f
Added (punctuation) spacing information to annotations.
Browse files- README.md +4 -3
- dataset_infos.json +1 -1
- solar3.py +20 -9
README.md
CHANGED
@@ -67,7 +67,8 @@ A sample instance from the dataset:
|
|
67 |
'lemma': ['”', 'ne', 'da', 'sovražiti', ...],
|
68 |
'ana': ['mte:U', 'mte:L', 'mte:Vd', ...],
|
69 |
'msd': ['UPosTag=PUNCT', 'UPosTag=PART|Polarity=Neg', 'UPosTag=SCONJ', ...],
|
70 |
-
'ne_tag': [..., 'O', 'B-PER', 'O', ...]
|
|
|
71 |
},
|
72 |
'tgt_tokens': ['„', 'Ne', 'da', 'sovražim', ',', 'da', 'ljubim', 'sem', 'na', 'svetu', ',', '”', 'izreče', 'Antigona', 'sebi', 'v', 'bran', 'kralju', 'Kreonu', 'za', 'svoje', 'nasprotno', 'mišljenje', 'pred', 'smrtjo', '.'],
|
73 |
# omitted for conciseness, the format is the same as in 'src_ling_annotations'
|
@@ -91,9 +92,9 @@ The instance represents a correction in the document 'solar1' (`id_doc`), which
|
|
91 |
- `doc_title`: a string containing the assigned document title;
|
92 |
- `is_manually_validated`: a bool indicating whether the document in which the sentence appears was reviewed by a teacher;
|
93 |
- `src_tokens`: words in the source sentence (`[]` if there is no source sentence);
|
94 |
-
- `src_ling_annotations`: a dict containing the lemmas (key `"lemma"`), morphosyntactic descriptions using UD (key `"msd"`) and JOS/MULTEXT-East (key `"ana"`) specification,
|
95 |
- `tgt_tokens`: words in the target sentence (`[]` if there is no target sentence);
|
96 |
-
- `tgt_ling_annotations`: a dict containing the lemmas (key `"lemma"`), morphosyntactic descriptions using UD (key `"msd"`) and JOS/MULTEXT-East (key `"ana"`) specification,
|
97 |
- `corrections`: a list of the corrections, with each correction represented with a dictionary, containing the indices of the source tokens involved (`idx_src`), target tokens involved (`idx_tgt`), and the categories of the corrections made (`corr_types`). Please note that there can be multiple assigned categories for one annotated correction, in which case `len(corr_types) > 1`.
|
98 |
|
99 |
|
|
|
67 |
'lemma': ['”', 'ne', 'da', 'sovražiti', ...],
|
68 |
'ana': ['mte:U', 'mte:L', 'mte:Vd', ...],
|
69 |
'msd': ['UPosTag=PUNCT', 'UPosTag=PART|Polarity=Neg', 'UPosTag=SCONJ', ...],
|
70 |
+
'ne_tag': [..., 'O', 'B-PER', 'O', ...],
|
71 |
+
'space_after': [False, True, True, False, ...]
|
72 |
},
|
73 |
'tgt_tokens': ['„', 'Ne', 'da', 'sovražim', ',', 'da', 'ljubim', 'sem', 'na', 'svetu', ',', '”', 'izreče', 'Antigona', 'sebi', 'v', 'bran', 'kralju', 'Kreonu', 'za', 'svoje', 'nasprotno', 'mišljenje', 'pred', 'smrtjo', '.'],
|
74 |
# omitted for conciseness, the format is the same as in 'src_ling_annotations'
|
|
|
92 |
- `doc_title`: a string containing the assigned document title;
|
93 |
- `is_manually_validated`: a bool indicating whether the document in which the sentence appears was reviewed by a teacher;
|
94 |
- `src_tokens`: words in the source sentence (`[]` if there is no source sentence);
|
95 |
+
- `src_ling_annotations`: a dict containing the lemmas (key `"lemma"`), morphosyntactic descriptions using UD (key `"msd"`) and JOS/MULTEXT-East (key `"ana"`) specification, named entity tags encoded using IOB2 (key `"ne_tag"`) for the source tokens (**automatically annotated**), and spacing information (key `"space_after"`), i.e. whether there is a whitespace after each token;
|
96 |
- `tgt_tokens`: words in the target sentence (`[]` if there is no target sentence);
|
97 |
+
- `tgt_ling_annotations`: a dict containing the lemmas (key `"lemma"`), morphosyntactic descriptions using UD (key `"msd"`) and JOS/MULTEXT-East (key `"ana"`) specification, named entity tags encoded using IOB2 (key `"ne_tag"`) for the target tokens (**automatically annotated**), and spacing information (key `"space_after"`), i.e. whether there is a whitespace after each token;
|
98 |
- `corrections`: a list of the corrections, with each correction represented with a dictionary, containing the indices of the source tokens involved (`idx_src`), target tokens involved (`idx_tgt`), and the categories of the corrections made (`corr_types`). Please note that there can be multiple assigned categories for one annotated correction, in which case `len(corr_types) > 1`.
|
99 |
|
100 |
|
dataset_infos.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"default": {"description": "\u0160olar is a developmental corpus of 5485 school texts (e.g., essays), written by students in Slovenian secondary schools \n(age 15-19) and pupils in the 7th-9th grade of primary school (13-15), with a small percentage also from the 6th grade. \nPart of the corpus (2,094 texts) is annotated with teachers' corrections using a system of labels described in the \ndocument available at https://www.clarin.si/repository/xmlui/bitstream/handle/11356/1589/Smernice-za-oznacevanje-korpusa-Solar_V1.1.pdf (in Slovenian).\n", "citation": "@misc{solar3.0,\n title = {Developmental corpus {\u000b S}olar 3.0},\n author = {Arhar Holdt, {\u000b S}pela and Rozman, Tadeja and Stritar Ku{\u000b c}uk, Mojca and Krek, Simon and Krap{\u000b s} Vodopivec, Irena and Stabej, Marko and Pori, Eva and Goli, Teja and Lavri{\u000b c}, Polona and Laskowski, Cyprian and Kocjan{\u000b c}i{\u000b c}, Polonca and Klemenc, Bojan and Krsnik, Luka and Kosem, Iztok},\n url = {http://hdl.handle.net/11356/1589},\n note = {Slovenian language resource repository {CLARIN}.{SI}},\n year = {2022}\n}\n", "homepage": "http://hdl.handle.net/11356/1589", "license": "Creative Commons - Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)", "features": {"id_doc": {"dtype": "string", "id": null, "_type": "Value"}, "doc_title": {"dtype": "string", "id": null, "_type": "Value"}, "is_manually_validated": {"dtype": "bool", "id": null, "_type": "Value"}, "id_src_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "src_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "id_tgt_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "tgt_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "corrections": [{"idx_src": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "idx_tgt": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "corr_types": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}]}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "solar3", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 120154479, "num_examples": 125867, "dataset_name": "solar3"}}, "download_checksums": {"https://www.clarin.si/repository/xmlui/bitstream/handle/11356/1589/Solar.TEI.zip": {"num_bytes": 99287852, "checksum": "188945c90c663cc34c77c6aefd40357b60b88436b3d9fd53f24304c927ac1cbf"}}, "download_size": 99287852, "post_processing_size": null, "dataset_size": 120154479, "size_in_bytes": 219442331}, "sentence_level": {"description": "\u0160olar is a developmental corpus of 5485 school texts (e.g., essays), written by students in Slovenian secondary schools \n(age 15-19) and pupils in the 7th-9th grade of primary school (13-15), with a small percentage also from the 6th grade. \nPart of the corpus (1516 texts) is annotated with teachers' corrections using a system of labels described in the \ndocument available at https://www.clarin.si/repository/xmlui/bitstream/handle/11356/1589/Smernice-za-oznacevanje-korpusa-Solar_V1.1.pdf (in Slovenian).\n", "citation": "@misc{solar3.0,\n title = {Developmental corpus {\u000b S}olar 3.0},\n author = {Arhar Holdt, {\u000b S}pela and Rozman, Tadeja and Stritar Ku{\u000b c}uk, Mojca and Krek, Simon and Krap{\u000b s} Vodopivec, Irena and Stabej, Marko and Pori, Eva and Goli, Teja and Lavri{\u000b c}, Polona and Laskowski, Cyprian and Kocjan{\u000b c}i{\u000b c}, Polonca and Klemenc, Bojan and Krsnik, Luka and Kosem, Iztok},\n url = {http://hdl.handle.net/11356/1589},\n note = {Slovenian language resource repository {CLARIN}.{SI}},\n year = {2022}\n}\n", "homepage": "http://hdl.handle.net/11356/1589", "license": "Creative Commons - Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)", "features": {"id_doc": {"dtype": "string", "id": null, "_type": "Value"}, "doc_title": {"dtype": "string", "id": null, "_type": "Value"}, "is_manually_validated": {"dtype": "bool", "id": null, "_type": "Value"}, "src_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "src_ling_annotations": {"lemma": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ana": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "msd": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ne_tag": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "tgt_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "tgt_ling_annotations": {"lemma": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ana": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "msd": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ne_tag": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "corrections": [{"idx_src": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "idx_tgt": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "corr_types": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}]}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "solar3", "config_name": "sentence_level", "version": {"version_str": "3.0.2", "description": null, "major": 3, "minor": 0, "patch": 2}, "splits": {"train": {"name": "train", "num_bytes": 317733578, "num_examples": 125867, "dataset_name": "solar3"}}, "download_checksums": {"https://www.clarin.si/repository/xmlui/bitstream/handle/11356/1589/Solar.TEI.zip": {"num_bytes": 99287852, "checksum": "188945c90c663cc34c77c6aefd40357b60b88436b3d9fd53f24304c927ac1cbf"}}, "download_size": 99287852, "post_processing_size": null, "dataset_size": 317733578, "size_in_bytes": 417021430}, "document_level": {"description": "\u0160olar is a developmental corpus of 5485 school texts (e.g., essays), written by students in Slovenian secondary schools \n(age 15-19) and pupils in the 7th-9th grade of primary school (13-15), with a small percentage also from the 6th grade. \nPart of the corpus (1516 texts) is annotated with teachers' corrections using a system of labels described in the \ndocument available at https://www.clarin.si/repository/xmlui/bitstream/handle/11356/1589/Smernice-za-oznacevanje-korpusa-Solar_V1.1.pdf (in Slovenian).\n", "citation": "@misc{solar3.0,\n title = {Developmental corpus {\u000b S}olar 3.0},\n author = {Arhar Holdt, {\u000b S}pela and Rozman, Tadeja and Stritar Ku{\u000b c}uk, Mojca and Krek, Simon and Krap{\u000b s} Vodopivec, Irena and Stabej, Marko and Pori, Eva and Goli, Teja and Lavri{\u000b c}, Polona and Laskowski, Cyprian and Kocjan{\u000b c}i{\u000b c}, Polonca and Klemenc, Bojan and Krsnik, Luka and Kosem, Iztok},\n url = {http://hdl.handle.net/11356/1589},\n note = {Slovenian language resource repository {CLARIN}.{SI}},\n year = {2022}\n}\n", "homepage": "http://hdl.handle.net/11356/1589", "license": "Creative Commons - Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)", "features": {"id_doc": {"dtype": "string", "id": null, "_type": "Value"}, "doc_title": {"dtype": "string", "id": null, "_type": "Value"}, "is_manually_validated": {"dtype": "bool", "id": null, "_type": "Value"}, "src_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "src_ling_annotations": {"lemma": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ana": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "msd": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ne_tag": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "tgt_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "tgt_ling_annotations": {"lemma": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ana": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "msd": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ne_tag": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "corrections": [{"idx_src": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "idx_tgt": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "corr_types": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}]}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "solar3", "config_name": "document_level", "version": {"version_str": "3.0.2", "description": null, "major": 3, "minor": 0, "patch": 2}, "splits": {"train": {"name": "train", "num_bytes": 305646012, "num_examples": 5485, "dataset_name": "solar3"}}, "download_checksums": {"https://www.clarin.si/repository/xmlui/bitstream/handle/11356/1589/Solar.TEI.zip": {"num_bytes": 99287852, "checksum": "188945c90c663cc34c77c6aefd40357b60b88436b3d9fd53f24304c927ac1cbf"}}, "download_size": 99287852, "post_processing_size": null, "dataset_size": 305646012, "size_in_bytes": 404933864}}
|
|
|
1 |
+
{"default": {"description": "\u0160olar is a developmental corpus of 5485 school texts (e.g., essays), written by students in Slovenian secondary schools \n(age 15-19) and pupils in the 7th-9th grade of primary school (13-15), with a small percentage also from the 6th grade. \nPart of the corpus (2,094 texts) is annotated with teachers' corrections using a system of labels described in the \ndocument available at https://www.clarin.si/repository/xmlui/bitstream/handle/11356/1589/Smernice-za-oznacevanje-korpusa-Solar_V1.1.pdf (in Slovenian).\n", "citation": "@misc{solar3.0,\n title = {Developmental corpus {\u000b S}olar 3.0},\n author = {Arhar Holdt, {\u000b S}pela and Rozman, Tadeja and Stritar Ku{\u000b c}uk, Mojca and Krek, Simon and Krap{\u000b s} Vodopivec, Irena and Stabej, Marko and Pori, Eva and Goli, Teja and Lavri{\u000b c}, Polona and Laskowski, Cyprian and Kocjan{\u000b c}i{\u000b c}, Polonca and Klemenc, Bojan and Krsnik, Luka and Kosem, Iztok},\n url = {http://hdl.handle.net/11356/1589},\n note = {Slovenian language resource repository {CLARIN}.{SI}},\n year = {2022}\n}\n", "homepage": "http://hdl.handle.net/11356/1589", "license": "Creative Commons - Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)", "features": {"id_doc": {"dtype": "string", "id": null, "_type": "Value"}, "doc_title": {"dtype": "string", "id": null, "_type": "Value"}, "is_manually_validated": {"dtype": "bool", "id": null, "_type": "Value"}, "id_src_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "src_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "id_tgt_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "tgt_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "corrections": [{"idx_src": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "idx_tgt": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "corr_types": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}]}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "solar3", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 120154479, "num_examples": 125867, "dataset_name": "solar3"}}, "download_checksums": {"https://www.clarin.si/repository/xmlui/bitstream/handle/11356/1589/Solar.TEI.zip": {"num_bytes": 99287852, "checksum": "188945c90c663cc34c77c6aefd40357b60b88436b3d9fd53f24304c927ac1cbf"}}, "download_size": 99287852, "post_processing_size": null, "dataset_size": 120154479, "size_in_bytes": 219442331}, "sentence_level": {"description": "\u0160olar is a developmental corpus of 5485 school texts (e.g., essays), written by students in Slovenian secondary schools \n(age 15-19) and pupils in the 7th-9th grade of primary school (13-15), with a small percentage also from the 6th grade. \nPart of the corpus (1516 texts) is annotated with teachers' corrections using a system of labels described in the \ndocument available at https://www.clarin.si/repository/xmlui/bitstream/handle/11356/1589/Smernice-za-oznacevanje-korpusa-Solar_V1.1.pdf (in Slovenian).\n", "citation": "@misc{solar3.0,\n title = {Developmental corpus {\u000b S}olar 3.0},\n author = {Arhar Holdt, {\u000b S}pela and Rozman, Tadeja and Stritar Ku{\u000b c}uk, Mojca and Krek, Simon and Krap{\u000b s} Vodopivec, Irena and Stabej, Marko and Pori, Eva and Goli, Teja and Lavri{\u000b c}, Polona and Laskowski, Cyprian and Kocjan{\u000b c}i{\u000b c}, Polonca and Klemenc, Bojan and Krsnik, Luka and Kosem, Iztok},\n url = {http://hdl.handle.net/11356/1589},\n note = {Slovenian language resource repository {CLARIN}.{SI}},\n year = {2022}\n}\n", "homepage": "http://hdl.handle.net/11356/1589", "license": "Creative Commons - Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)", "features": {"id_doc": {"dtype": "string", "id": null, "_type": "Value"}, "doc_title": {"dtype": "string", "id": null, "_type": "Value"}, "is_manually_validated": {"dtype": "bool", "id": null, "_type": "Value"}, "src_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "src_ling_annotations": {"lemma": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ana": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "msd": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ne_tag": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "space_after": {"feature": {"dtype": "bool", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "tgt_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "tgt_ling_annotations": {"lemma": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ana": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "msd": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ne_tag": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "space_after": {"feature": {"dtype": "bool", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "corrections": [{"idx_src": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "idx_tgt": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "corr_types": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}]}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "solar3", "config_name": "sentence_level", "version": {"version_str": "3.0.2", "description": null, "major": 3, "minor": 0, "patch": 2}, "splits": {"train": {"name": "train", "num_bytes": 319173974, "num_examples": 125867, "dataset_name": "solar3"}}, "download_checksums": {"https://www.clarin.si/repository/xmlui/bitstream/handle/11356/1589/Solar.TEI.zip": {"num_bytes": 99287852, "checksum": "188945c90c663cc34c77c6aefd40357b60b88436b3d9fd53f24304c927ac1cbf"}}, "download_size": 99287852, "post_processing_size": null, "dataset_size": 319173974, "size_in_bytes": 418461826}, "document_level": {"description": "\u0160olar is a developmental corpus of 5485 school texts (e.g., essays), written by students in Slovenian secondary schools \n(age 15-19) and pupils in the 7th-9th grade of primary school (13-15), with a small percentage also from the 6th grade. \nPart of the corpus (1516 texts) is annotated with teachers' corrections using a system of labels described in the \ndocument available at https://www.clarin.si/repository/xmlui/bitstream/handle/11356/1589/Smernice-za-oznacevanje-korpusa-Solar_V1.1.pdf (in Slovenian).\n", "citation": "@misc{solar3.0,\n title = {Developmental corpus {\u000b S}olar 3.0},\n author = {Arhar Holdt, {\u000b S}pela and Rozman, Tadeja and Stritar Ku{\u000b c}uk, Mojca and Krek, Simon and Krap{\u000b s} Vodopivec, Irena and Stabej, Marko and Pori, Eva and Goli, Teja and Lavri{\u000b c}, Polona and Laskowski, Cyprian and Kocjan{\u000b c}i{\u000b c}, Polonca and Klemenc, Bojan and Krsnik, Luka and Kosem, Iztok},\n url = {http://hdl.handle.net/11356/1589},\n note = {Slovenian language resource repository {CLARIN}.{SI}},\n year = {2022}\n}\n", "homepage": "http://hdl.handle.net/11356/1589", "license": "Creative Commons - Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)", "features": {"id_doc": {"dtype": "string", "id": null, "_type": "Value"}, "doc_title": {"dtype": "string", "id": null, "_type": "Value"}, "is_manually_validated": {"dtype": "bool", "id": null, "_type": "Value"}, "src_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "src_ling_annotations": {"lemma": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ana": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "msd": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ne_tag": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "space_after": {"feature": {"dtype": "bool", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "tgt_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "tgt_ling_annotations": {"lemma": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ana": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "msd": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ne_tag": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "space_after": {"feature": {"dtype": "bool", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "corrections": [{"idx_src": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "idx_tgt": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "corr_types": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}]}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "solar3", "config_name": "document_level", "version": {"version_str": "3.0.2", "description": null, "major": 3, "minor": 0, "patch": 2}, "splits": {"train": {"name": "train", "num_bytes": 306153740, "num_examples": 5485, "dataset_name": "solar3"}}, "download_checksums": {"https://www.clarin.si/repository/xmlui/bitstream/handle/11356/1589/Solar.TEI.zip": {"num_bytes": 99287852, "checksum": "188945c90c663cc34c77c6aefd40357b60b88436b3d9fd53f24304c927ac1cbf"}}, "download_size": 99287852, "post_processing_size": null, "dataset_size": 306153740, "size_in_bytes": 405441592}}
|
solar3.py
CHANGED
@@ -52,8 +52,9 @@ def resolve_element(tag_el, ne_tag: Optional[str] = "O"):
|
|
52 |
msd = tag_el.attrib["msd"] # UD specifications
|
53 |
ret_ne_tag = ne_tag
|
54 |
id_tag = tag_el.attrib[f"{XML_NAMESPACE}id"]
|
|
|
55 |
|
56 |
-
return [(id_tag, form, lemma, ana, msd, ret_ne_tag)]
|
57 |
# Named entities: words and punctuation nested directly below current element
|
58 |
elif tag_el.tag.endswith("seg"):
|
59 |
anns = []
|
@@ -108,7 +109,7 @@ def read_data(data_path):
|
|
108 |
for idx_par, curr_par in enumerate(curr_text.iterfind(f".//{NAMESPACE}p")):
|
109 |
for idx_sent, curr_sent in enumerate(curr_par.iterfind(f".//{NAMESPACE}s")):
|
110 |
id_sent = curr_sent.attrib[f"{XML_NAMESPACE}id"]
|
111 |
-
ids, forms, lemmas, msds, nes = [], [], [], [], []
|
112 |
msds_jos, msds_ud = [], []
|
113 |
for curr_el in curr_sent:
|
114 |
curr_annotations = resolve_element(curr_el)
|
@@ -119,11 +120,12 @@ def read_data(data_path):
|
|
119 |
msds_jos.append(curr_ann[3])
|
120 |
msds_ud.append(curr_ann[4])
|
121 |
nes.append(curr_ann[5])
|
|
|
122 |
|
123 |
data[id_sent] = {
|
124 |
"id_doc": id_text,
|
125 |
"doc_title": text_title,
|
126 |
-
"id_token": ids, "form": forms, "lemma": lemmas, "ana": msds_jos, "msd": msds_ud, "ne_tag": nes,
|
127 |
"is_manually_validated": is_manually_validated
|
128 |
}
|
129 |
|
@@ -156,14 +158,16 @@ class Solar3(datasets.GeneratorBasedBuilder):
|
|
156 |
"lemma": datasets.Sequence(datasets.Value("string")),
|
157 |
"ana": datasets.Sequence(datasets.Value("string")),
|
158 |
"msd": datasets.Sequence(datasets.Value("string")),
|
159 |
-
"ne_tag": datasets.Sequence(datasets.Value("string"))
|
|
|
160 |
},
|
161 |
"tgt_tokens": datasets.Sequence(datasets.Value("string")),
|
162 |
"tgt_ling_annotations": {
|
163 |
"lemma": datasets.Sequence(datasets.Value("string")),
|
164 |
"ana": datasets.Sequence(datasets.Value("string")),
|
165 |
"msd": datasets.Sequence(datasets.Value("string")),
|
166 |
-
"ne_tag": datasets.Sequence(datasets.Value("string"))
|
|
|
167 |
},
|
168 |
"corrections": [
|
169 |
{
|
@@ -228,6 +232,7 @@ class Solar3(datasets.GeneratorBasedBuilder):
|
|
228 |
src_sent_data["ana"].extend(curr_sent_data["ana"])
|
229 |
src_sent_data["msd"].extend(curr_sent_data["msd"])
|
230 |
src_sent_data["ne_tag"].extend(curr_sent_data["ne_tag"])
|
|
|
231 |
|
232 |
id_doc = src_sent_data["id_doc"]
|
233 |
doc_title = src_sent_data["doc_title"]
|
@@ -245,6 +250,7 @@ class Solar3(datasets.GeneratorBasedBuilder):
|
|
245 |
tgt_sent_data["ana"].extend(curr_sent_data["ana"])
|
246 |
tgt_sent_data["msd"].extend(curr_sent_data["msd"])
|
247 |
tgt_sent_data["ne_tag"].extend(curr_sent_data["ne_tag"])
|
|
|
248 |
|
249 |
id_doc = tgt_sent_data["id_doc"]
|
250 |
doc_title = tgt_sent_data["doc_title"]
|
@@ -285,7 +291,8 @@ class Solar3(datasets.GeneratorBasedBuilder):
|
|
285 |
"lemma": src_sent_data.get("lemma", []),
|
286 |
"ana": src_sent_data.get("ana", []),
|
287 |
"msd": src_sent_data.get("msd", []),
|
288 |
-
"ne_tag": src_sent_data.get("ne_tag", [])
|
|
|
289 |
},
|
290 |
"id_tgt_tokens": tgt_sent_data.get("id_token", []),
|
291 |
"tgt_tokens": tgt_sent_data.get("form", []),
|
@@ -293,7 +300,8 @@ class Solar3(datasets.GeneratorBasedBuilder):
|
|
293 |
"lemma": tgt_sent_data.get("lemma", []),
|
294 |
"ana": tgt_sent_data.get("ana", []),
|
295 |
"msd": tgt_sent_data.get("msd", []),
|
296 |
-
"ne_tag": tgt_sent_data.get("ne_tag", [])
|
|
|
297 |
},
|
298 |
"corrections": corr_data
|
299 |
}
|
@@ -305,8 +313,8 @@ class Solar3(datasets.GeneratorBasedBuilder):
|
|
305 |
curr_instances = map(lambda tup: tup[1], curr_group) # remove the redundant index info from datasets
|
306 |
|
307 |
src_tokens, tgt_tokens, mapped_corrections = [], [], []
|
308 |
-
src_ling_anns = {"lemma": [], "ana": [], "msd": [], "ne_tag": []}
|
309 |
-
tgt_ling_anns = {"lemma": [], "ana": [], "msd": [], "ne_tag": []}
|
310 |
seen_src_tokens, seen_tgt_tokens = {}, {}
|
311 |
# Need to keep the current base position of source and target tokens AND previous base position:
|
312 |
# A source may map into multiple targets (or vice versa), but we do not want to write it twice in a doc.
|
@@ -332,6 +340,7 @@ class Solar3(datasets.GeneratorBasedBuilder):
|
|
332 |
src_ling_anns["ana"].append(curr_src_anns["ana"][idx_position])
|
333 |
src_ling_anns["msd"].append(curr_src_anns["msd"][idx_position])
|
334 |
src_ling_anns["ne_tag"].append(curr_src_anns["ne_tag"][idx_position])
|
|
|
335 |
|
336 |
seen_src_tokens[id_tok] = tok
|
337 |
num_added_src += 1
|
@@ -343,6 +352,7 @@ class Solar3(datasets.GeneratorBasedBuilder):
|
|
343 |
tgt_ling_anns["ana"].append(curr_tgt_anns["ana"][idx_position])
|
344 |
tgt_ling_anns["msd"].append(curr_tgt_anns["msd"][idx_position])
|
345 |
tgt_ling_anns["ne_tag"].append(curr_tgt_anns["ne_tag"][idx_position])
|
|
|
346 |
|
347 |
seen_tgt_tokens[id_tok] = tok
|
348 |
num_added_tgt += 1
|
@@ -389,3 +399,4 @@ class Solar3(datasets.GeneratorBasedBuilder):
|
|
389 |
yield i, {_k: _v for _k, _v in instance.items() if _k not in {"id_src_tokens", "id_tgt_tokens"}}
|
390 |
else:
|
391 |
yield from list(Solar3.aggregate_docs(sent_level_data))
|
|
|
|
52 |
msd = tag_el.attrib["msd"] # UD specifications
|
53 |
ret_ne_tag = ne_tag
|
54 |
id_tag = tag_el.attrib[f"{XML_NAMESPACE}id"]
|
55 |
+
space_after = False if "join" in tag_el.attrib and tag_el.attrib["join"]=="right" else True
|
56 |
|
57 |
+
return [(id_tag, form, lemma, ana, msd, ret_ne_tag, space_after)]
|
58 |
# Named entities: words and punctuation nested directly below current element
|
59 |
elif tag_el.tag.endswith("seg"):
|
60 |
anns = []
|
|
|
109 |
for idx_par, curr_par in enumerate(curr_text.iterfind(f".//{NAMESPACE}p")):
|
110 |
for idx_sent, curr_sent in enumerate(curr_par.iterfind(f".//{NAMESPACE}s")):
|
111 |
id_sent = curr_sent.attrib[f"{XML_NAMESPACE}id"]
|
112 |
+
ids, forms, lemmas, msds, nes, spaces_after = [], [], [], [], [], []
|
113 |
msds_jos, msds_ud = [], []
|
114 |
for curr_el in curr_sent:
|
115 |
curr_annotations = resolve_element(curr_el)
|
|
|
120 |
msds_jos.append(curr_ann[3])
|
121 |
msds_ud.append(curr_ann[4])
|
122 |
nes.append(curr_ann[5])
|
123 |
+
spaces_after.append(curr_ann[6])
|
124 |
|
125 |
data[id_sent] = {
|
126 |
"id_doc": id_text,
|
127 |
"doc_title": text_title,
|
128 |
+
"id_token": ids, "form": forms, "lemma": lemmas, "ana": msds_jos, "msd": msds_ud, "ne_tag": nes, "space_after": spaces_after,
|
129 |
"is_manually_validated": is_manually_validated
|
130 |
}
|
131 |
|
|
|
158 |
"lemma": datasets.Sequence(datasets.Value("string")),
|
159 |
"ana": datasets.Sequence(datasets.Value("string")),
|
160 |
"msd": datasets.Sequence(datasets.Value("string")),
|
161 |
+
"ne_tag": datasets.Sequence(datasets.Value("string")),
|
162 |
+
"space_after": datasets.Sequence(datasets.Value("bool"))
|
163 |
},
|
164 |
"tgt_tokens": datasets.Sequence(datasets.Value("string")),
|
165 |
"tgt_ling_annotations": {
|
166 |
"lemma": datasets.Sequence(datasets.Value("string")),
|
167 |
"ana": datasets.Sequence(datasets.Value("string")),
|
168 |
"msd": datasets.Sequence(datasets.Value("string")),
|
169 |
+
"ne_tag": datasets.Sequence(datasets.Value("string")),
|
170 |
+
"space_after": datasets.Sequence(datasets.Value("bool"))
|
171 |
},
|
172 |
"corrections": [
|
173 |
{
|
|
|
232 |
src_sent_data["ana"].extend(curr_sent_data["ana"])
|
233 |
src_sent_data["msd"].extend(curr_sent_data["msd"])
|
234 |
src_sent_data["ne_tag"].extend(curr_sent_data["ne_tag"])
|
235 |
+
src_sent_data["space_after"].extend(curr_sent_data["space_after"])
|
236 |
|
237 |
id_doc = src_sent_data["id_doc"]
|
238 |
doc_title = src_sent_data["doc_title"]
|
|
|
250 |
tgt_sent_data["ana"].extend(curr_sent_data["ana"])
|
251 |
tgt_sent_data["msd"].extend(curr_sent_data["msd"])
|
252 |
tgt_sent_data["ne_tag"].extend(curr_sent_data["ne_tag"])
|
253 |
+
tgt_sent_data["space_after"].extend(curr_sent_data["space_after"])
|
254 |
|
255 |
id_doc = tgt_sent_data["id_doc"]
|
256 |
doc_title = tgt_sent_data["doc_title"]
|
|
|
291 |
"lemma": src_sent_data.get("lemma", []),
|
292 |
"ana": src_sent_data.get("ana", []),
|
293 |
"msd": src_sent_data.get("msd", []),
|
294 |
+
"ne_tag": src_sent_data.get("ne_tag", []),
|
295 |
+
"space_after": src_sent_data.get("space_after", [])
|
296 |
},
|
297 |
"id_tgt_tokens": tgt_sent_data.get("id_token", []),
|
298 |
"tgt_tokens": tgt_sent_data.get("form", []),
|
|
|
300 |
"lemma": tgt_sent_data.get("lemma", []),
|
301 |
"ana": tgt_sent_data.get("ana", []),
|
302 |
"msd": tgt_sent_data.get("msd", []),
|
303 |
+
"ne_tag": tgt_sent_data.get("ne_tag", []),
|
304 |
+
"space_after": tgt_sent_data.get("space_after", [])
|
305 |
},
|
306 |
"corrections": corr_data
|
307 |
}
|
|
|
313 |
curr_instances = map(lambda tup: tup[1], curr_group) # remove the redundant index info from datasets
|
314 |
|
315 |
src_tokens, tgt_tokens, mapped_corrections = [], [], []
|
316 |
+
src_ling_anns = {"lemma": [], "ana": [], "msd": [], "ne_tag": [], "space_after": []}
|
317 |
+
tgt_ling_anns = {"lemma": [], "ana": [], "msd": [], "ne_tag": [], "space_after": []}
|
318 |
seen_src_tokens, seen_tgt_tokens = {}, {}
|
319 |
# Need to keep the current base position of source and target tokens AND previous base position:
|
320 |
# A source may map into multiple targets (or vice versa), but we do not want to write it twice in a doc.
|
|
|
340 |
src_ling_anns["ana"].append(curr_src_anns["ana"][idx_position])
|
341 |
src_ling_anns["msd"].append(curr_src_anns["msd"][idx_position])
|
342 |
src_ling_anns["ne_tag"].append(curr_src_anns["ne_tag"][idx_position])
|
343 |
+
src_ling_anns["space_after"].append(curr_src_anns["space_after"][idx_position])
|
344 |
|
345 |
seen_src_tokens[id_tok] = tok
|
346 |
num_added_src += 1
|
|
|
352 |
tgt_ling_anns["ana"].append(curr_tgt_anns["ana"][idx_position])
|
353 |
tgt_ling_anns["msd"].append(curr_tgt_anns["msd"][idx_position])
|
354 |
tgt_ling_anns["ne_tag"].append(curr_tgt_anns["ne_tag"][idx_position])
|
355 |
+
tgt_ling_anns["space_after"].append(curr_tgt_anns["space_after"][idx_position])
|
356 |
|
357 |
seen_tgt_tokens[id_tok] = tok
|
358 |
num_added_tgt += 1
|
|
|
399 |
yield i, {_k: _v for _k, _v in instance.items() if _k not in {"id_src_tokens", "id_tgt_tokens"}}
|
400 |
else:
|
401 |
yield from list(Solar3.aggregate_docs(sent_level_data))
|
402 |
+
|