Aashraya Sachdeva commited on
Commit
3bee934
·
1 Parent(s): 3ff5d2f
.gitattributes CHANGED
@@ -52,3 +52,27 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
52
  *.jpg filter=lfs diff=lfs merge=lfs -text
53
  *.jpeg filter=lfs diff=lfs merge=lfs -text
54
  *.webp filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  *.jpg filter=lfs diff=lfs merge=lfs -text
53
  *.jpeg filter=lfs diff=lfs merge=lfs -text
54
  *.webp filter=lfs diff=lfs merge=lfs -text
55
+ train_dev/fr-dev.conll filter=lfs diff=lfs merge=lfs -text
56
+ train_dev/sv-train.conll filter=lfs diff=lfs merge=lfs -text
57
+ train_dev/zh-dev.conll filter=lfs diff=lfs merge=lfs -text
58
+ train_dev/en-train.conll filter=lfs diff=lfs merge=lfs -text
59
+ train_dev/fa-dev.conll filter=lfs diff=lfs merge=lfs -text
60
+ train_dev/fa-train.conll filter=lfs diff=lfs merge=lfs -text
61
+ train_dev/bn-train.conll filter=lfs diff=lfs merge=lfs -text
62
+ train_dev/de-dev.conll filter=lfs diff=lfs merge=lfs -text
63
+ train_dev/es-dev.conll filter=lfs diff=lfs merge=lfs -text
64
+ train_dev/hi-train.conll filter=lfs diff=lfs merge=lfs -text
65
+ train_dev/it-dev.conll filter=lfs diff=lfs merge=lfs -text
66
+ train_dev/it-train.conll filter=lfs diff=lfs merge=lfs -text
67
+ train_dev/pt-dev.conll filter=lfs diff=lfs merge=lfs -text
68
+ train_dev/pt-train.conll filter=lfs diff=lfs merge=lfs -text
69
+ train_dev/de-train.conll filter=lfs diff=lfs merge=lfs -text
70
+ train_dev/fr-train.conll filter=lfs diff=lfs merge=lfs -text
71
+ train_dev/hi-dev.conll filter=lfs diff=lfs merge=lfs -text
72
+ train_dev/uk-dev.conll filter=lfs diff=lfs merge=lfs -text
73
+ train_dev/zh-train.conll filter=lfs diff=lfs merge=lfs -text
74
+ train_dev/sv-dev.conll filter=lfs diff=lfs merge=lfs -text
75
+ train_dev/uk-train.conll filter=lfs diff=lfs merge=lfs -text
76
+ train_dev/bn-dev.conll filter=lfs diff=lfs merge=lfs -text
77
+ train_dev/en-dev.conll filter=lfs diff=lfs merge=lfs -text
78
+ train_dev/es-train.conll filter=lfs diff=lfs merge=lfs -text
multiconer2.py ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import datasets
2
+
3
+ logger = datasets.logging.get_logger(__name__)
4
+
5
+
6
+ # TODO: Add BibTeX citation
7
+ # Find for instance the citation on arxiv or on the dataset repo/website
8
+ _CITATION = """\
9
+ @InProceedings{huggingface:dataset,
10
+ title = {A great new dataset},
11
+ author={huggingface, Inc.
12
+ },
13
+ year={2020}
14
+ }
15
+ """
16
+
17
+ # TODO: Add description of the dataset here
18
+ # You can copy an official description
19
+ _DESCRIPTION = """\
20
+ SemEval 2023 Task 2: MultiCoNER II
21
+ Multilingual Complex Named Entity Recognition
22
+ """
23
+
24
+ # TODO: Add a link to an official homepage for the dataset here
25
+ _HOMEPAGE = "https://multiconer.github.io/"
26
+
27
+ # TODO: Add the licence for the dataset here if you can find it
28
+ _LICENSE = ""
29
+
30
+ # TODO: Add link to the official dataset URLs here
31
+ # The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
32
+ # This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
33
+ _URLS = ""
34
+
35
+
36
+ class Multiconer2Config(datasets.BuilderConfig):
37
+ """BuilderConfig for Multiconer2"""
38
+
39
+ def __init__(self, **kwargs):
40
+ """BuilderConfig for Multiconer2.
41
+ Args:
42
+ **kwargs: keyword arguments forwarded to super.
43
+ """
44
+ super(Multiconer2Config, self).__init__(**kwargs)
45
+
46
+
47
+ class Multiconer2(datasets.GeneratorBasedBuilder):
48
+ VERSION = datasets.Version("1.0.0")
49
+
50
+ # This is an example of a dataset with multiple configurations.
51
+ # If you don't want/need to define several sub-sets in your dataset,
52
+ # just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
53
+
54
+ # If you need to make complex sub-parts in the datasets with configurable options
55
+ # You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig
56
+ # BUILDER_CONFIG_CLASS = MyBuilderConfig
57
+
58
+ # You will be able to load one or the other configurations in the following list with
59
+ # data = datasets.load_dataset('my_dataset', 'first_domain')
60
+ # data = datasets.load_dataset('my_dataset', 'second_domain')
61
+ BUILDER_CONFIGS = [
62
+ Multiconer2Config(name="bn", version=VERSION),
63
+ Multiconer2Config(name="de", version=VERSION),
64
+ Multiconer2Config(name="en", version=VERSION),
65
+ Multiconer2Config(name="es", version=VERSION),
66
+ Multiconer2Config(name="fa", version=VERSION),
67
+ Multiconer2Config(name="fr", version=VERSION),
68
+ Multiconer2Config(name="hi", version=VERSION),
69
+ Multiconer2Config(name="it", version=VERSION),
70
+ Multiconer2Config(name="pt", version=VERSION),
71
+ Multiconer2Config(name="sv", version=VERSION),
72
+ Multiconer2Config(name="uk", version=VERSION),
73
+ Multiconer2Config(name="zh", version=VERSION),
74
+ ]
75
+
76
+ DEFAULT_CONFIG_NAME = "en"
77
+
78
+ def _info(self):
79
+ return datasets.DatasetInfo(
80
+ description=_DESCRIPTION,
81
+ features=datasets.Features(
82
+ {
83
+ "id": datasets.Value("string"),
84
+ "tokens": datasets.Sequence(datasets.Value("string")),
85
+ "ner_tags": datasets.Sequence(
86
+ datasets.features.ClassLabel(
87
+ names=['O',
88
+ "B-AerospaceManufacturer", 'I-AerospaceManufacturer',
89
+ 'B-AnatomicalStructure', 'I-AnatomicalStructure',
90
+ 'B-ArtWork', 'I-ArtWork',
91
+ 'B-Artist', 'I-Artist',
92
+ 'B-Athlete', 'I-Athlete',
93
+ 'B-CarManufacturer', 'I-CarManufacturer',
94
+ 'B-Cleric', 'I-Cleric',
95
+ 'B-Clothing', 'I-Clothing',
96
+ 'B-Disease', 'I-Disease',
97
+ 'B-Drink', 'I-Drink',
98
+ 'B-Facility', 'I-Facility',
99
+ 'B-Food', 'I-Food',
100
+ 'B-HumanSettlement', 'I-HumanSettlement',
101
+ 'B-MedicalProcedure', 'I-MedicalProcedure',
102
+ 'B-Medication/Vaccine', 'I-Medication/Vaccine',
103
+ 'B-MusicalGRP', 'I-MusicalGRP',
104
+ 'B-MusicalWork', 'I-MusicalWork',
105
+ 'B-ORG', 'I-ORG',
106
+ 'B-OtherLOC', 'I-OtherLOC',
107
+ 'B-OtherPER', 'I-OtherPER',
108
+ 'B-OtherPROD', 'I-OtherPROD',
109
+ 'B-Politician', 'I-Politician',
110
+ 'B-PrivateCorp', 'I-PrivateCorp',
111
+ 'B-PublicCorp', 'I-PublicCorp',
112
+ 'B-Scientist', 'I-Scientist',
113
+ 'B-Software', 'I-Software',
114
+ 'B-SportsGRP', 'I-SportsGRP',
115
+ 'B-SportsManager', 'I-SportsManager',
116
+ 'B-Station', 'I-Station',
117
+ 'B-Symptom', 'I-Symptom',
118
+ 'B-Vehicle', 'I-Vehicle',
119
+ 'B-VisualWork', 'I-VisualWork',
120
+ 'B-WrittenWork', 'I-WrittenWork']
121
+ )
122
+ ),
123
+ }
124
+ ),
125
+ supervised_keys=None,
126
+ homepage="https://www.aclweb.org/anthology/W03-0419/",
127
+ citation=_CITATION,
128
+ )
129
+
130
+ def _split_generators(self, dl_manager: datasets.DownloadManager):
131
+ """Returns SplitGenerators."""
132
+ logger.info("hello")
133
+ return [
134
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": f"train_dev/{self.config.name}-train.conll"}),
135
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": f"train_dev/{self.config.name}-dev.conll"}),
136
+ ]
137
+
138
+ def _generate_examples(self, filepath):
139
+ logger.info("⏳ Generating examples from = %s", filepath)
140
+ with open(filepath, encoding="utf-8") as f:
141
+ guid = 0
142
+ tokens = []
143
+ ner_tags = []
144
+ for line in f:
145
+ if line.startswith("#") or line == "" or line == "\n":
146
+ if tokens:
147
+ yield guid, {
148
+ "id": str(guid),
149
+ "tokens": tokens,
150
+ "ner_tags": ner_tags,
151
+ }
152
+ guid += 1
153
+ tokens = []
154
+ ner_tags = []
155
+ else:
156
+ # conll2003 tokens are space separated
157
+ splits = line.split(" _ _ ")
158
+ tokens.append(splits[0])
159
+ ner_tags.append(splits[1].rstrip())
160
+ # last example
161
+ if tokens:
162
+ yield guid, {
163
+ "id": str(guid),
164
+ "tokens": tokens,
165
+ "ner_tags": ner_tags,
166
+ }
train_dev/bn-dev.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a005da8249be9db1031829cdd0fd737d83df6ceb3d030604d3543bdcc79c3026
3
+ size 199049
train_dev/bn-train.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d584c5d528003fa00717712f02918e579f02f83044120e7cf94363e573849da
3
+ size 3818156
train_dev/de-dev.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f998cedd47546190bfb0afc95671a6209f7849e16e36570968df9b6b0a3d6f43
3
+ size 138318
train_dev/de-train.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4bc6b1b2ae3cc59daa1f5fa8c8b403768fd224e6565b4aae580d3de434694256
3
+ size 2693495
train_dev/en-dev.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cef0633da09ab2ee3386576818acad0aef47e124ca7c7ec557e18de6974326df
3
+ size 227151
train_dev/en-train.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e1af77f95e92aa287c40feb7c10b384192c8ff026c916114a54713f331138ea
3
+ size 4348311
train_dev/es-dev.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:275721c0e4406673bc60b799d742f67092769e89975fb3537be16b71dbb3a820
3
+ size 228474
train_dev/es-train.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b7576554fece7069eb867a232708021618d83700d8b32dbb0a496a1e8d4ddc5
3
+ size 4430590
train_dev/fa-dev.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:506f319c606b463b557673f9afa98851489c00027ffc5fd1c12bf2d065d0d29e
3
+ size 294271
train_dev/fa-train.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9a5f7cf628791375fce6934af48d71704cf3391e31e247760ec9b2657a7d4261
3
+ size 5466230
train_dev/fr-dev.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2432c3560fc46da827b66c9512e0cbbed3fdabc7e1443eb75e1247f4fc9fc03f
3
+ size 223574
train_dev/fr-train.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:81f1746bd30ebeb3c4dc4ad7f52992bba3947b2e4938e3d4e1dc894cc900b5db
3
+ size 4268589
train_dev/hi-dev.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b25fa13c93635e489da1d2f2c9895ae5642916f6cbeccd49b0a7bd76159a5e60
3
+ size 207547
train_dev/hi-train.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:615a4026c191bd7d871651dd4629ed93281d16b8c441b06bccf935e416593313
3
+ size 3852637
train_dev/it-dev.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:533623bec0979f598125162d19bd3a66ae35856b13b72d5128db61b7501422b9
3
+ size 220058
train_dev/it-train.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0fc8a2a7791489afd03974002ca3e165b776c66ac7a348fb9954983171f34fe3
3
+ size 4234654
train_dev/pt-dev.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:70aaa516afeb962c083ebf0f57e3afed26235af7b3ed02e29a1efbb8ce16bc7e
3
+ size 226036
train_dev/pt-train.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:166eec67036114278e9b61ba09d7c2c814df37ce8a8e97dd8c1048613318cdfc
3
+ size 4396298
train_dev/sv-dev.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f78d7b0e28ba65e0f0447442864842cc456b127c188a6b0a32295267b78caec4
3
+ size 205982
train_dev/sv-train.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91b45297c02883c2e81e974c8eef63cdaa7994f35f87c7b2d7cfaf181f453ced
3
+ size 3894803
train_dev/uk-dev.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b84e8a6f6fb58576b07f70dcf01b3075f9b927314e0c57453d03f1a9ce4b5fc
3
+ size 256472
train_dev/uk-train.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa6d107cac8fa251ff8b80bf5c11830bb22b14c21ac377914ef0d9a2761120f8
3
+ size 4989211
train_dev/zh-dev.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6400fbaec6f0a9bbab78e7ab400d4a75ce93a7027d5ce03d58b58fd42d09e922
3
+ size 195243
train_dev/zh-train.conll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e53891573f54e975812fa4703eddcd59f017dc833d7d8b0471c92b6fa6e3aad
3
+ size 3740743