alba.taboas commited on
Commit
592fcef
·
0 Parent(s):

Initial commit: syntactic agreement dataset

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +1 -0
  2. .gitignore +1 -0
  3. SyntacticAgreement.py +101 -0
  4. italian/article_noun_agreement.json +3 -0
  5. italian/attribute_agreement.json +3 -0
  6. italian/attribute_agreement_with_modifiers.json +3 -0
  7. italian/noun_adjective_agreement.json +3 -0
  8. italian/participle_agreement.json +3 -0
  9. italian/participle_agreement_with_modifiers.json +3 -0
  10. italian/possessive_noun_agreement.json +3 -0
  11. italian/predicative_agreement.json +3 -0
  12. italian/predicative_agreement_with_modifiers.json +3 -0
  13. italian/subject_verb_agreement_basic.json +3 -0
  14. italian/subject_verb_agreement_orc.json +3 -0
  15. italian/subject_verb_agreement_src.json +3 -0
  16. portuguese/article_noun_agreement.json +3 -0
  17. portuguese/attribute_agreement.json +3 -0
  18. portuguese/attribute_agreement_orc.json +3 -0
  19. portuguese/attribute_agreement_src.json +3 -0
  20. portuguese/noun_adjective_agreement.json +3 -0
  21. portuguese/passive_participle_agreement.json +3 -0
  22. portuguese/passive_participle_agreement_with_modifiers.json +3 -0
  23. portuguese/possessive_noun_agreement.json +3 -0
  24. portuguese/predicative_agreement.json +3 -0
  25. portuguese/predicative_agreement_with_modifiers.json +3 -0
  26. portuguese/subject_verb_agreement_basic.json +3 -0
  27. portuguese/subject_verb_agreement_orc.json +3 -0
  28. portuguese/subject_verb_agreement_src.json +3 -0
  29. russian/attribute_agreement.json +3 -0
  30. russian/attribute_agreement_with_modifiers.json +3 -0
  31. russian/determiner_noun_agreement_genitive.json +3 -0
  32. russian/determiner_noun_agreement_instrumental.json +3 -0
  33. russian/determiner_noun_agreement_prepositional.json +3 -0
  34. russian/noun_adjective_agreement_accusative.json +3 -0
  35. russian/noun_adjective_agreement_dative.json +3 -0
  36. russian/noun_adjective_agreement_nominative.json +3 -0
  37. russian/predicative_agreement.json +3 -0
  38. russian/predicative_agreement_with_modifiers.json +3 -0
  39. russian/subject_verb_agreement_basic.json +3 -0
  40. russian/subject_verb_agreement_past.json +3 -0
  41. russian/subject_verb_agreement_past_with_modifiers.json +3 -0
  42. spanish/article_noun_agreement.json +3 -0
  43. spanish/attribute_agreement.json +3 -0
  44. spanish/attribute_agreement_orc.json +3 -0
  45. spanish/attribute_agreement_src.json +3 -0
  46. spanish/noun_adjective_agreement.json +3 -0
  47. spanish/passive_participle_agreement.json +3 -0
  48. spanish/passive_participle_agreement_with_modifiers.json +3 -0
  49. spanish/predicative_agreement.json +3 -0
  50. spanish/predicative_agreement_with_modifiers.json +3 -0
.gitattributes ADDED
@@ -0,0 +1 @@
 
 
1
+ *.json filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ .idea/
SyntacticAgreement.py ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import json
3
+ from datasets import (
4
+ GeneratorBasedBuilder,
5
+ DatasetInfo,
6
+ Features,
7
+ Value,
8
+ Sequence,
9
+ Split,
10
+ SplitGenerator,
11
+ BuilderConfig,
12
+ )
13
+
14
+ # Define features of your dataset
15
+ SUITE_DATASET_CONDITION_SPEC = {
16
+ "condition_name": Value("string"),
17
+ "content": Value("string"),
18
+ "regions": Sequence({
19
+ "region_number": Value("int32"),
20
+ "content": Value("string"),
21
+ }),
22
+ }
23
+
24
+ SUITE_DATASET_SPEC = Features({
25
+ "suite_name": Value("string"),
26
+ "item_number": Value("int32"),
27
+ "conditions": Sequence(SUITE_DATASET_CONDITION_SPEC),
28
+ "predictions": Sequence(Value("string")),
29
+ })
30
+
31
+ class SyntacticAgreement(GeneratorBasedBuilder):
32
+ BUILDER_CONFIG_CLASS = BuilderConfig
33
+ BUILDER_CONFIGS = [
34
+ BuilderConfig(name="spanish", description="Spanish syntax test suites", data_dir="https://huggingface.co/datasets/albalbalba/SyntacticAgreement/tree/main"),
35
+ BuilderConfig(name="italian", description="Italian syntax test suites", data_dir="https://huggingface.co/datasets/albalbalba/SyntacticAgreement/tree/main"),
36
+ BuilderConfig(name="portuguese", description="Portuguese syntax test suites", data_dir="https://huggingface.co/datasets/albalbalba/SyntacticAgreement/tree/main"),
37
+ BuilderConfig(name="russian", description="Russian syntax test suites", data_dir="https://huggingface.co/datasets/albalbalba/SyntacticAgreement/tree/main"),
38
+ ]
39
+
40
+ def _info(self):
41
+ return DatasetInfo(
42
+ description="Agreement syntax test suites.",
43
+ features=SUITE_DATASET_SPEC,
44
+ supervised_keys=None,
45
+ homepage="",
46
+ license="",
47
+ citation="",
48
+ )
49
+
50
+ def _split_generators(self, dl_manager):
51
+ # Point to the folder containing language-specific JSONs
52
+ base_url = "https://huggingface.co/datasets/albalbalba/SyntacticAgreement/resolve/main"
53
+ data_dir = dl_manager.download_and_extract(
54
+ f"{base_url}/{self.config.name}"
55
+ )
56
+ return [
57
+ SplitGenerator(name=Split.TRAIN, gen_kwargs={"data_dir": data_dir}),
58
+ ]
59
+
60
+ def _generate_examples(self, data_dir):
61
+ # Iterate through local folder after download
62
+ for filename in sorted(os.listdir(data_dir)):
63
+ if not filename.endswith(".json"):
64
+ continue
65
+ filepath = os.path.join(data_dir, filename)
66
+ with open(filepath, encoding="utf-8") as f:
67
+ data = json.load(f)
68
+
69
+ suite_name = data["meta"]["name"]
70
+ predictions = [p["formula"] for p in data.get("predictions", [])]
71
+
72
+ for item in data.get("items", []):
73
+ item_number = item["item_number"]
74
+ conditions = []
75
+ for condition in item.get("conditions", []):
76
+ content_all = " ".join([region["content"] for region in condition["regions"]]).lstrip(" ")
77
+ content_all = (
78
+ content_all.replace(" ", " ")
79
+ .replace(" .", ".")
80
+ .replace(" ,", ",")
81
+ .replace("¿ ", "¿")
82
+ )
83
+ conditions.append({
84
+ "condition_name": condition["condition_name"],
85
+ "content": content_all,
86
+ "regions": [
87
+ {
88
+ "region_number": region["region_number"],
89
+ "content": region["content"],
90
+ }
91
+ for region in condition["regions"]
92
+ ],
93
+ })
94
+
95
+ key = f"{suite_name}_{item_number}"
96
+ yield key, {
97
+ "suite_name": suite_name,
98
+ "item_number": item_number,
99
+ "conditions": conditions,
100
+ "predictions": predictions,
101
+ }
italian/article_noun_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:275f23bb766982531709ebeea4a6081dcae07a6ccbdc8580280c91f1bb0f2d21
3
+ size 60166
italian/attribute_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:984ce5cb3e5cf97caa795003fdac421fad2dce633fd196889291fb063352802e
3
+ size 80570
italian/attribute_agreement_with_modifiers.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9241a9d54b99911f56d9b429a38f07e3e4a85ea89c2161bb56c405249a60728
3
+ size 49590
italian/noun_adjective_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4de691695b5f3f5d47943613a5634d5d03fc8d7534e82d0ce84af6cba25ac13
3
+ size 62192
italian/participle_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:42d4796ef7aede94ee86768736c40d666e98f0bea9207b6d079213dc658de38f
3
+ size 38760
italian/participle_agreement_with_modifiers.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e25146713fefc82fda99a76c287127dcbcfb2b5278d074fe215c43ef2578c10
3
+ size 47223
italian/possessive_noun_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a154ea6b2838e24bc85534fb08ddb65747e67a301d66ddae01848e4893fae8c8
3
+ size 60683
italian/predicative_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af27bf084011203c25a6b47cdaa363238b57b8b7d55f57731cbb4b0816717c06
3
+ size 82124
italian/predicative_agreement_with_modifiers.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4f957f2b4a9d6a99765443ef04b54fb630198961a5467811b2d7ea3ec70aecc
3
+ size 54767
italian/subject_verb_agreement_basic.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f6710e93c69b1c2f976de082d5be8feeafa95ed699fc74735dd56d53dc5870d
3
+ size 88897
italian/subject_verb_agreement_orc.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6beb5720eacaeb1f58d97da2f533726cb9a05ce24d801efd3ec67a0d00fb9ec
3
+ size 97123
italian/subject_verb_agreement_src.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:278851ea7cdbe1bf987bff89218ef487afeb1d5e141004b588218d919daeb40c
3
+ size 97100
portuguese/article_noun_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6bc92ba1af4f5ff2404b20c3ae725f1eac4aead672a6f11aecb6e37c5ff95b4d
3
+ size 60111
portuguese/attribute_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:89d597cd5777d1007d98827341615b6b32cd6a462c694fda98fd668fd994ba93
3
+ size 80803
portuguese/attribute_agreement_orc.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:42c1b830166006bd7f1bf8b455125c419b9a1fcb735c03913472630a43619fe7
3
+ size 53455
portuguese/attribute_agreement_src.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72cf73852c760fd6b31ee87dba762628fe16b6be0476d689a257ae6dba028f8c
3
+ size 52755
portuguese/noun_adjective_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff305b440bd15c0b2387d52c0b6b4d01b985948bf199844992981953a7b9d031
3
+ size 62654
portuguese/passive_participle_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ac1feed588c357e3fdbd90abab0e790ea3fcbae73be2a4efc6f449d7c769f52
3
+ size 39126
portuguese/passive_participle_agreement_with_modifiers.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41a3da8cc67a0cd886665a5c56dc601a13860752c01b0cec21197471c9cf8f43
3
+ size 48128
portuguese/possessive_noun_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0d2d719c7b17a437f2a2d6960737277147dedd93b7420e87c6f3a402c742d0c1
3
+ size 60926
portuguese/predicative_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1fb3c8dce374060e095995a9af6cdc195cf3d38d278088d86b1ae1b0b1d2e12
3
+ size 66806
portuguese/predicative_agreement_with_modifiers.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0ea145fca93b84a6b0d58fd452e8a3fdbc9e3f7e77a1f5866e00baf8dea3e977
3
+ size 50928
portuguese/subject_verb_agreement_basic.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c4390738cb871c27e01a93dd3d7d99afe6acdf8f641c21faeb559c36069b460
3
+ size 88968
portuguese/subject_verb_agreement_orc.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec001cb7e2ce856f35e3749ce615aa63d6db7827b62d8acb45e63d3a4d33f4f4
3
+ size 96956
portuguese/subject_verb_agreement_src.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0191732893b099d7a70a60e47653d7cad5424c714a967745091248752b7679e9
3
+ size 96937
russian/attribute_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fdc509c1e32c9e9123886620c5aa2314696f31a28f4579ee03ff8e7fddf30c34
3
+ size 61638
russian/attribute_agreement_with_modifiers.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0191b5e6bba2b32d39b1c0a152b61841b8cdc73376f8b25104c35e3a28d05138
3
+ size 59128
russian/determiner_noun_agreement_genitive.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:92c67b75a85e0a6c6cf20a8a4bbb1fda2d46974d4f12ebcd2c11a435450eaad4
3
+ size 88944
russian/determiner_noun_agreement_instrumental.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d158ea27cdee682c903c1a20f8c684f8ab9ab2030ece9ef6443cbf4876023e38
3
+ size 115685
russian/determiner_noun_agreement_prepositional.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9f7fb0a862b149e2124f146774286afb0580627de621c59700441fd1d78a1d2f
3
+ size 84697
russian/noun_adjective_agreement_accusative.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:28544548a1e4df86796109db5b5c2707b09c61cb6c909ac31852d9e934c47d89
3
+ size 97976
russian/noun_adjective_agreement_dative.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e04ee13d04820d33af75469326dc2d8ab6e2d24e75dabd8167daf0f527abd6ad
3
+ size 155383
russian/noun_adjective_agreement_nominative.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4210149c677bfb2d18a7ccf8bf7f8508a90a4ccdb9ae898875cf314fee4ff44
3
+ size 93261
russian/predicative_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef9f3bbcdfbb781049481147426397cbece06131d06294de38a0ee444b5e0b77
3
+ size 69933
russian/predicative_agreement_with_modifiers.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:112dd758da56a313c267100136ae6557c28dce806f2f55793b58118f47c71893
3
+ size 64515
russian/subject_verb_agreement_basic.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e8de2b6edd69736621fc12a7c236ccaf88daaa7d0e5ac3c87f7143c168df06d
3
+ size 100134
russian/subject_verb_agreement_past.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ad10052ed190621044464fa66e3b1e3eddcf50255a7ecb008a6d22b40f7df0ab
3
+ size 61690
russian/subject_verb_agreement_past_with_modifiers.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0fd211dfa08fea7096cdfaace9f63dd96d0dfb14f37db1cd6a24684895126107
3
+ size 58526
spanish/article_noun_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ab92262a0cfd06bd74263d7a895fe93683cb91bdd46abda32aa12c33dfa75d86
3
+ size 60411
spanish/attribute_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df07bab4955d4c16defcea8b9fa2b46be00a7cecb506889bbb1344ed76178d88
3
+ size 81075
spanish/attribute_agreement_orc.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b4a2d51cab88d8dabcf8b3788ae5c75086263fdc9652ee725f8dcaf65a5d615
3
+ size 53270
spanish/attribute_agreement_src.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6ebe406506254bfbb0561cdf9628ffe44003a3a02e4ba3e91bd153deffc4bfd
3
+ size 53376
spanish/noun_adjective_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f318c0933f3ad59de834744c8e08f84ea448831195a42345f92ce84cd9822641
3
+ size 61827
spanish/passive_participle_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df62731e44fb0d93f64274e8ce01e64e8e49e4f35f218e8a02077e9b8c7569b4
3
+ size 39432
spanish/passive_participle_agreement_with_modifiers.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fca4abce6a4c68d4941b4fa69925a25a8fc48885cf9f17376d926bca476a4862
3
+ size 48313
spanish/predicative_agreement.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:294298e5b585dbd45785964e331f043b08bb61d52f9ac6c6993ab543025ad3da
3
+ size 82532
spanish/predicative_agreement_with_modifiers.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82ef548bd6e99f2b901773694c06cf9e5b9d865e87a02d4fea04960d871ca655
3
+ size 51402