jfrenz commited on
Commit
0dac6e0
1 Parent(s): 8b1cfb4

Noch ein fehler in lener-br

Browse files
Files changed (2) hide show
  1. dataset_infos.json +1 -1
  2. legalglue.py +8 -8
dataset_infos.json CHANGED
@@ -1 +1 @@
1
- {"german_ler": {"description": "description", "citation": "@inproceedings{leitner2019fine,\nauthor = {Elena Leitner and Georg Rehm and Julian Moreno-Schneider},\ntitle = {{Fine-grained Named Entity Recognition in Legal Documents}},\nbooktitle = {Semantic Systems. The Power of AI and Knowledge\n Graphs. Proceedings of the 15th International Conference\n (SEMANTiCS 2019)},\nyear = 2019,\neditor = {Maribel Acosta and Philippe Cudr\u00e9-Mauroux and Maria\n Maleshkova and Tassilo Pellegrini and Harald Sack and York\n Sure-Vetter},\nkeywords = {aip},\npublisher = {Springer},\nseries = {Lecture Notes in Computer Science},\nnumber = {11702},\naddress = {Karlsruhe, Germany},\nmonth = 9,\nnote = {10/11 September 2019},\npages = {272--287},\npdf = {https://link.springer.com/content/pdf/10.1007%2F978-3-030-33220-4_20.pdf}}\n", "homepage": "https://github.com/elenanereiss/Legal-Entity-Recognition", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ner_tags": {"feature": {"num_classes": 39, "names": ["B-AN", "B-EUN", "B-GRT", "B-GS", "B-INN", "B-LD", "B-LDS", "B-LIT", "B-MRK", "B-ORG", "B-PER", "B-RR", "B-RS", "B-ST", "B-STR", "B-UN", "B-VO", "B-VS", "B-VT", "I-AN", "I-EUN", "I-GRT", "I-GS", "I-INN", "I-LD", "I-LDS", "I-LIT", "I-MRK", "I-ORG", "I-PER", "I-RR", "I-RS", "I-ST", "I-STR", "I-UN", "I-VO", "I-VS", "I-VT", "O"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "legal_glue", "config_name": "german_ler", "version": {"version_str": "1.1.0", "description": "", "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 38853928, "num_examples": 66723, "dataset_name": "legal_glue"}}, "download_checksums": {"https://raw.githubusercontent.com/elenanereiss/Legal-Entity-Recognition/master/data/dataset_courts.zip": {"num_bytes": 4392913, "checksum": "f0427df5fb8bfdefe5228bc0fa0e75e9cfa782d1a78e32582cce096473c88567"}}, "download_size": 4392913, "post_processing_size": null, "dataset_size": 38853928, "size_in_bytes": 43246841}, "lener_br": {"description": "LeNER-Br is a Portuguese language dataset for named entity recognition\napplied to legal documents. LeNER-Br consists entirely of manually annotated\nlegislation and legal cases texts and contains tags for persons, locations,\ntime entities, organizations, legislation and legal cases.\nTo compose the dataset, 66 legal documents from several Brazilian Courts were\ncollected. Courts of superior and state levels were considered, such as Supremo\nTribunal Federal, Superior Tribunal de Justi\u00e7a, Tribunal de Justi\u00e7a de Minas\nGerais and Tribunal de Contas da Uni\u00e3o. In addition, four legislation documents\nwere collected, such as \"Lei Maria da Penha\", giving a total of 70 documents\n", "citation": "@inproceedings{luz_etal_propor2018,\nauthor = {Pedro H. {Luz de Araujo} and Te'{o}filo E. {de Campos} and\nRenato R. R. {de Oliveira} and Matheus Stauffer and\nSamuel Couto and Paulo Bermejo},\ntitle = {{LeNER-Br}: a Dataset for Named Entity Recognition in {Brazilian} Legal Text},\nbooktitle = {International Conference on the Computational Processing of Portuguese ({PROPOR})},\npublisher = {Springer},\nseries = {Lecture Notes on Computer Science ({LNCS})},\npages = {313--323},\nyear = {2018},\nmonth = {September 24-26},\naddress = {Canela, RS, Brazil},\ndoi = {10.1007/978-3-319-99722-3_32},\nurl = {https://cic.unb.br/~teodecampos/LeNER-Br/},\n}\n", "homepage": "https://cic.unb.br/~teodecampos/LeNER-Br/", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ner_tags": {"feature": {"num_classes": 13, "names": ["O", "B-ORGANIZACAO", "I-ORGANIZACAO", "B-PESSOA", "I-PESSOA", "B-TEMPO", "I-TEMPO", "B-LOCAL", "I-LOCAL", "B-LEGISLACAO", "I-LEGISLACAO", "B-JURISPRUDENCIA", "I-JURISPRUDENCIA"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "legal_glue", "config_name": "lener_br", "version": {"version_str": "1.1.0", "description": "", "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 3984189, "num_examples": 7828, "dataset_name": "legal_glue"}, "test": {"name": "test", "num_bytes": 719433, "num_examples": 1177, "dataset_name": "legal_glue"}, "validation": {"name": "validation", "num_bytes": 823708, "num_examples": 1390, "dataset_name": "legal_glue"}}, "download_checksums": {"https://github.com/peluz/lener-br/raw/master/leNER-Br/train/train.conll": {"num_bytes": 2142199, "checksum": "6fdf9066333c84565f9e3d28ee8f0f519336bece69b63f8d78b8de0fe96dcd47"}, "https://github.com/peluz/lener-br/raw/master/leNER-Br/test/test.conll": {"num_bytes": 438441, "checksum": "f90cd26a31afc2d1f132c4473d40c26d2283a98b374025fa5b5985b723dce825"}, "https://github.com/peluz/lener-br/raw/master/leNER-Br/dev/dev.conll": {"num_bytes": 402497, "checksum": "7e350feb828198031e57c21d6aadbf8dac92b19a684e45d7081c6cb491e2063b"}}, "download_size": 2983137, "post_processing_size": null, "dataset_size": 5527330, "size_in_bytes": 8510467}, "cuad": {"description": "Contract Understanding Atticus Dataset (CUAD) v1 is a corpus of more than 13,000 labels in 510\ncommercial legal contracts that have been manually labeled to identify 41 categories of important\nclauses that lawyers look for when reviewing contracts in connection with corporate transactions.\n", "citation": "@article{hendrycks2021cuad,\ntitle={CUAD: An Expert-Annotated NLP Dataset for Legal Contract Review},\nauthor={Dan Hendrycks and Collin Burns and Anya Chen and Spencer Ball},\njournal={arXiv preprint arXiv:2103.06268},\nyear={2021}\n}\n", "homepage": "https://www.atticusprojectai.org/cuad", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "context": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answers": {"feature": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "answer_start": {"dtype": "int32", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "legal_glue", "config_name": "cuad", "version": {"version_str": "1.1.0", "description": "", "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 1466037640, "num_examples": 22450, "dataset_name": "legal_glue"}, "test": {"name": "test", "num_bytes": 198543467, "num_examples": 4182, "dataset_name": "legal_glue"}}, "download_checksums": {"https://github.com/TheAtticusProject/cuad/raw/main/data.zip": {"num_bytes": 18309308, "checksum": "f8161d18bea4e9c05e78fa6dda61c19c846fb8087ea969c172753bc2f45b999a"}}, "download_size": 18309308, "post_processing_size": null, "dataset_size": 1664581107, "size_in_bytes": 1682890415}}
 
1
+ {"german_ler": {"description": "description", "citation": "@inproceedings{leitner2019fine,\nauthor = {Elena Leitner and Georg Rehm and Julian Moreno-Schneider},\ntitle = {{Fine-grained Named Entity Recognition in Legal Documents}},\nbooktitle = {Semantic Systems. The Power of AI and Knowledge\n Graphs. Proceedings of the 15th International Conference\n (SEMANTiCS 2019)},\nyear = 2019,\neditor = {Maribel Acosta and Philippe Cudr\u00e9-Mauroux and Maria\n Maleshkova and Tassilo Pellegrini and Harald Sack and York\n Sure-Vetter},\nkeywords = {aip},\npublisher = {Springer},\nseries = {Lecture Notes in Computer Science},\nnumber = {11702},\naddress = {Karlsruhe, Germany},\nmonth = 9,\nnote = {10/11 September 2019},\npages = {272--287},\npdf = {https://link.springer.com/content/pdf/10.1007%2F978-3-030-33220-4_20.pdf}}\n", "homepage": "https://github.com/elenanereiss/Legal-Entity-Recognition", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ner_tags": {"feature": {"num_classes": 39, "names": ["B-AN", "B-EUN", "B-GRT", "B-GS", "B-INN", "B-LD", "B-LDS", "B-LIT", "B-MRK", "B-ORG", "B-PER", "B-RR", "B-RS", "B-ST", "B-STR", "B-UN", "B-VO", "B-VS", "B-VT", "I-AN", "I-EUN", "I-GRT", "I-GS", "I-INN", "I-LD", "I-LDS", "I-LIT", "I-MRK", "I-ORG", "I-PER", "I-RR", "I-RS", "I-ST", "I-STR", "I-UN", "I-VO", "I-VS", "I-VT", "O"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "legal_glue", "config_name": "german_ler", "version": {"version_str": "1.1.0", "description": "", "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 38853928, "num_examples": 66723, "dataset_name": "legal_glue"}}, "download_checksums": {"https://raw.githubusercontent.com/elenanereiss/Legal-Entity-Recognition/master/data/dataset_courts.zip": {"num_bytes": 4392913, "checksum": "f0427df5fb8bfdefe5228bc0fa0e75e9cfa782d1a78e32582cce096473c88567"}}, "download_size": 4392913, "post_processing_size": null, "dataset_size": 38853928, "size_in_bytes": 43246841}, "lener_br": {"description": "LeNER-Br is a Portuguese language dataset for named entity recognition\napplied to legal documents. LeNER-Br consists entirely of manually annotated\nlegislation and legal cases texts and contains tags for persons, locations,\ntime entities, organizations, legislation and legal cases.\nTo compose the dataset, 66 legal documents from several Brazilian Courts were\ncollected. Courts of superior and state levels were considered, such as Supremo\nTribunal Federal, Superior Tribunal de Justi\u00e7a, Tribunal de Justi\u00e7a de Minas\nGerais and Tribunal de Contas da Uni\u00e3o. In addition, four legislation documents\nwere collected, such as \"Lei Maria da Penha\", giving a total of 70 documents\n", "citation": "@inproceedings{luz_etal_propor2018,\nauthor = {Pedro H. {Luz de Araujo} and Te'{o}filo E. {de Campos} and\nRenato R. R. {de Oliveira} and Matheus Stauffer and\nSamuel Couto and Paulo Bermejo},\ntitle = {{LeNER-Br}: a Dataset for Named Entity Recognition in {Brazilian} Legal Text},\nbooktitle = {International Conference on the Computational Processing of Portuguese ({PROPOR})},\npublisher = {Springer},\nseries = {Lecture Notes on Computer Science ({LNCS})},\npages = {313--323},\nyear = {2018},\nmonth = {September 24-26},\naddress = {Canela, RS, Brazil},\ndoi = {10.1007/978-3-319-99722-3_32},\nurl = {https://cic.unb.br/~teodecampos/LeNER-Br/},\n}\n", "homepage": "https://cic.unb.br/~teodecampos/LeNER-Br/", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ner_tags": {"feature": {"num_classes": 13, "names": ["O", "B-ORGANIZACAO", "I-ORGANIZACAO", "B-PESSOA", "I-PESSOA", "B-TEMPO", "I-TEMPO", "B-LOCAL", "I-LOCAL", "B-LEGISLACAO", "I-LEGISLACAO", "B-JURISPRUDENCIA", "I-JURISPRUDENCIA"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "legal_glue", "config_name": "lener_br", "version": {"version_str": "1.1.0", "description": "", "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 3984189, "num_examples": 7828, "dataset_name": "legal_glue"}, "test": {"name": "test", "num_bytes": 823708, "num_examples": 1390, "dataset_name": "legal_glue"}, "validation": {"name": "validation", "num_bytes": 719433, "num_examples": 1177, "dataset_name": "legal_glue"}}, "download_checksums": {"https://github.com/peluz/lener-br/raw/master/leNER-Br/train/train.conll": {"num_bytes": 2142199, "checksum": "6fdf9066333c84565f9e3d28ee8f0f519336bece69b63f8d78b8de0fe96dcd47"}, "https://github.com/peluz/lener-br/raw/master/leNER-Br/dev/dev.conll": {"num_bytes": 402497, "checksum": "7e350feb828198031e57c21d6aadbf8dac92b19a684e45d7081c6cb491e2063b"}, "https://github.com/peluz/lener-br/raw/master/leNER-Br/test/test.conll": {"num_bytes": 438441, "checksum": "f90cd26a31afc2d1f132c4473d40c26d2283a98b374025fa5b5985b723dce825"}}, "download_size": 2983137, "post_processing_size": null, "dataset_size": 5527330, "size_in_bytes": 8510467}, "cuad": {"description": "Contract Understanding Atticus Dataset (CUAD) v1 is a corpus of more than 13,000 labels in 510\ncommercial legal contracts that have been manually labeled to identify 41 categories of important\nclauses that lawyers look for when reviewing contracts in connection with corporate transactions.\n", "citation": "@article{hendrycks2021cuad,\ntitle={CUAD: An Expert-Annotated NLP Dataset for Legal Contract Review},\nauthor={Dan Hendrycks and Collin Burns and Anya Chen and Spencer Ball},\njournal={arXiv preprint arXiv:2103.06268},\nyear={2021}\n}\n", "homepage": "https://www.atticusprojectai.org/cuad", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "context": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answers": {"feature": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "answer_start": {"dtype": "int32", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "legal_glue", "config_name": "cuad", "version": {"version_str": "1.1.0", "description": "", "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 1466037640, "num_examples": 22450, "dataset_name": "legal_glue"}, "test": {"name": "test", "num_bytes": 198543467, "num_examples": 4182, "dataset_name": "legal_glue"}}, "download_checksums": {"https://github.com/TheAtticusProject/cuad/raw/main/data.zip": {"num_bytes": 18309308, "checksum": "f8161d18bea4e9c05e78fa6dda61c19c846fb8087ea969c172753bc2f45b999a"}}, "download_size": 18309308, "post_processing_size": null, "dataset_size": 1664581107, "size_in_bytes": 1682890415}}
legalglue.py CHANGED
@@ -337,8 +337,8 @@ class LegalGLUE(datasets.GeneratorBasedBuilder):
337
  elif self.config.name == "lener_br":
338
  urls_to_download = {
339
  "train": self.config.data_url + self.config.data_files[0],
340
- "dev": self.config.data_url + self.config.data_files[2],
341
- "test": self.config.data_url + self.config.data_files[1],
342
  }
343
  archive = dl_manager.download_and_extract(urls_to_download)
344
  return[
@@ -460,27 +460,27 @@ class LegalGLUE(datasets.GeneratorBasedBuilder):
460
  with open(files, encoding="utf-8") as f:
461
  id = 0
462
  tokens = []
463
- tags = []
464
  for line in f:
465
  if line == "" or line == "\n":
466
  if tokens:
467
  yield id, {
468
  "id": str(id),
469
  "tokens": tokens,
470
- "ner_tags": tags,
471
  }
472
  id += 1
473
  tokens = []
474
- tags = []
475
  else:
476
- token, tag = line.split()
477
  tokens.append(token)
478
- tags.append(tag.rstrip())
479
 
480
  yield id, {
481
  "id": str(id),
482
  "tokens": tokens,
483
- "ner_tags": tags,
484
  }
485
 
486
  elif self.config.name == "cuad":
 
337
  elif self.config.name == "lener_br":
338
  urls_to_download = {
339
  "train": self.config.data_url + self.config.data_files[0],
340
+ "dev": self.config.data_url + self.config.data_files[1],
341
+ "test": self.config.data_url + self.config.data_files[2],
342
  }
343
  archive = dl_manager.download_and_extract(urls_to_download)
344
  return[
 
460
  with open(files, encoding="utf-8") as f:
461
  id = 0
462
  tokens = []
463
+ ner_tags = []
464
  for line in f:
465
  if line == "" or line == "\n":
466
  if tokens:
467
  yield id, {
468
  "id": str(id),
469
  "tokens": tokens,
470
+ "ner_tags": ner_tags,
471
  }
472
  id += 1
473
  tokens = []
474
+ ner_tags = []
475
  else:
476
+ token, tag = line.split(" ")
477
  tokens.append(token)
478
+ ner_tags.append(tag.rstrip())
479
 
480
  yield id, {
481
  "id": str(id),
482
  "tokens": tokens,
483
+ "ner_tags": ner_tags,
484
  }
485
 
486
  elif self.config.name == "cuad":