jfrenz commited on
Commit
a3e6daa
1 Parent(s): b047cf4

Fehler in lener-br behoben

Browse files
Files changed (1) hide show
  1. legalglue.py +76 -6
legalglue.py CHANGED
@@ -84,6 +84,32 @@ LENER_BR=[
84
  "I-JURISPRUDENCIA",
85
  ]
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  class LegalGlueConfig(datasets.BuilderConfig):
88
  """BuilderConfig for LegalGLUE."""
89
 
@@ -95,6 +121,9 @@ class LegalGlueConfig(datasets.BuilderConfig):
95
  citation, #citation for the dataset
96
  data_url,
97
  data_files,
 
 
 
98
  **kwargs,
99
  ):
100
  super(LegalGlueConfig, self).__init__(version=datasets.Version("1.1.0", ""), **kwargs)
@@ -104,6 +133,13 @@ class LegalGlueConfig(datasets.BuilderConfig):
104
  self.citation = citation
105
  self.data_url = data_url
106
  self.data_files = data_files
 
 
 
 
 
 
 
107
 
108
 
109
 
@@ -142,7 +178,9 @@ class LegalGLUE(datasets.GeneratorBasedBuilder):
142
  note = {10/11 September 2019},
143
  pages = {272--287},
144
  pdf = {https://link.springer.com/content/pdf/10.1007%2F978-3-030-33220-4_20.pdf}}
145
- """)
 
 
146
  ),
147
  LegalGlueConfig(
148
  name="lener_br",
@@ -180,7 +218,8 @@ class LegalGLUE(datasets.GeneratorBasedBuilder):
180
  doi = {10.1007/978-3-319-99722-3_32},
181
  url = {https://cic.unb.br/~teodecampos/LeNER-Br/},
182
  }
183
- """)
 
184
  ),
185
  LegalGlueConfig(
186
  name="cuad",
@@ -203,8 +242,39 @@ class LegalGLUE(datasets.GeneratorBasedBuilder):
203
  journal={arXiv preprint arXiv:2103.06268},
204
  year={2021}
205
  }
206
- """)
207
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  ]
209
 
210
  def _info(self):
@@ -401,7 +471,7 @@ class LegalGLUE(datasets.GeneratorBasedBuilder):
401
  }
402
  id += 1
403
  tokens = []
404
- ner_tags = []
405
  else:
406
  token, tag = line.split()
407
  tokens.append(token)
@@ -410,7 +480,7 @@ class LegalGLUE(datasets.GeneratorBasedBuilder):
410
  yield id, {
411
  "id": str(id),
412
  "tokens": tokens,
413
- "ner_tags": ner_tags,
414
  }
415
 
416
  elif self.config.name == "cuad":
 
84
  "I-JURISPRUDENCIA",
85
  ]
86
 
87
+ # MULTI_EURLEX_LANGUAGES = [
88
+ # "en",
89
+ # "da",
90
+ # "de",
91
+ # "nl",
92
+ # "sv",
93
+ # "bg",
94
+ # "cs",
95
+ # "hr",
96
+ # "pl",
97
+ # "sk",
98
+ # "sl",
99
+ # "es",
100
+ # "fr",
101
+ # "it",
102
+ # "pt",
103
+ # "ro",
104
+ # "et",
105
+ # "fi",
106
+ # "hu",
107
+ # "lt",
108
+ # "lv",
109
+ # "el",
110
+ # "mt",
111
+ # ]
112
+
113
  class LegalGlueConfig(datasets.BuilderConfig):
114
  """BuilderConfig for LegalGLUE."""
115
 
 
121
  citation, #citation for the dataset
122
  data_url,
123
  data_files,
124
+ # language,
125
+ # languages = None,
126
+ # label_level = None,
127
  **kwargs,
128
  ):
129
  super(LegalGlueConfig, self).__init__(version=datasets.Version("1.1.0", ""), **kwargs)
 
133
  self.citation = citation
134
  self.data_url = data_url
135
  self.data_files = data_files
136
+ # self.language = language
137
+ # self.label_level = label_level
138
+ #
139
+ # if language != "all_languages":
140
+ # self.languages = [language]
141
+ # else:
142
+ # self.languages = languages if languages is not None else MULTI_EURLEX_LANGUAGES
143
 
144
 
145
 
 
178
  note = {10/11 September 2019},
179
  pages = {272--287},
180
  pdf = {https://link.springer.com/content/pdf/10.1007%2F978-3-030-33220-4_20.pdf}}
181
+ """),
182
+ # language= "German"
183
+
184
  ),
185
  LegalGlueConfig(
186
  name="lener_br",
 
218
  doi = {10.1007/978-3-319-99722-3_32},
219
  url = {https://cic.unb.br/~teodecampos/LeNER-Br/},
220
  }
221
+ """),
222
+ # language = "Portuguese"
223
  ),
224
  LegalGlueConfig(
225
  name="cuad",
 
242
  journal={arXiv preprint arXiv:2103.06268},
243
  year={2021}
244
  }
245
+ """),
246
+ # language = "English"
247
+ ),
248
+ # LegalGlueConfig(
249
+ # name="multi_eurlex",
250
+ # description=textwrap.dedent(
251
+ # """\
252
+ # MultiEURLEX comprises 65k EU laws in 23 official EU languages (some low-ish resource).
253
+ # Each EU law has been annotated with EUROVOC concepts (labels) by the Publication Office of EU.
254
+ # As with the English EURLEX, the goal is to predict the relevant EUROVOC concepts (labels);
255
+ # this is multi-label classification task (given the text, predict multiple labels).
256
+ # """
257
+ # ),
258
+ # label_classes=None,
259
+ # multi_label=True,
260
+ # data_url="https://zenodo.org/record/5363165/files/multi_eurlex.tar.gz",
261
+ # data_files=["train.json", "test.json", "dev.json"],
262
+ # # homepage="https://www.atticusprojectai.org/cuad",
263
+ # citation=textwrap.dedent("""\
264
+ # @InProceedings{chalkidis-etal-2021-multieurlex,
265
+ # author = {Chalkidis, Ilias
266
+ # and Fergadiotis, Manos
267
+ # and Androutsopoulos, Ion},
268
+ # title = {MultiEURLEX -- A multi-lingual and multi-label legal document
269
+ # classification dataset for zero-shot cross-lingual transfer},
270
+ # booktitle = {Proceedings of the 2021 Conference on Empirical Methods
271
+ # in Natural Language Processing},
272
+ # year = {2021},
273
+ # publisher = {Association for Computational Linguistics},
274
+ # location = {Punta Cana, Dominican Republic},
275
+ # }"""
276
+ # )
277
+ # )
278
  ]
279
 
280
  def _info(self):
 
471
  }
472
  id += 1
473
  tokens = []
474
+ tags = []
475
  else:
476
  token, tag = line.split()
477
  tokens.append(token)
 
480
  yield id, {
481
  "id": str(id),
482
  "tokens": tokens,
483
+ "ner_tags": tags,
484
  }
485
 
486
  elif self.config.name == "cuad":