SaylorTwift HF Staff commited on
Commit
1472fd1
·
verified ·
1 Parent(s): 1f25392

Delete loading script

Browse files
Files changed (1) hide show
  1. legal_summarization.py +0 -61
legal_summarization.py DELETED
@@ -1,61 +0,0 @@
1
- import datasets
2
- import os
3
- import json
4
-
5
-
6
- _CITATION = """
7
-
8
- """
9
-
10
- _DESCRIPTION = """
11
-
12
- """
13
-
14
- class Builder(datasets.GeneratorBasedBuilder):
15
- VERSION = datasets.Version("1.0.0")
16
-
17
- BUILDER_CONFIGS = [
18
- datasets.BuilderConfig(name=name, version=datasets.Version("1.0.0"), description=_DESCRIPTION)
19
- for name in ["BillSum", "MultiLexSum", "EurLexSum"]
20
- ]
21
-
22
- def _info(self):
23
- features = datasets.Features(
24
- {
25
- "article": datasets.Value("string"),
26
- "summary": datasets.Value("string"),
27
- }
28
- )
29
- return datasets.DatasetInfo(
30
- description=_DESCRIPTION,
31
- features=features,
32
- homepage="",
33
- license="",
34
- citation=_CITATION,
35
- )
36
-
37
- def _split_generators(self, dl_manager):
38
- train_json = dl_manager.download(os.path.join(self.config.name, "train.jsonl"))
39
- if self.config.name != "BillSum":
40
- valid_json = dl_manager.download(os.path.join(self.config.name, "validation.jsonl"))
41
- test_json = dl_manager.download(os.path.join(self.config.name, "test.jsonl"))
42
-
43
- return [
44
- datasets.SplitGenerator(
45
- name=datasets.Split.TRAIN,
46
- gen_kwargs={"path": train_json},
47
- ),
48
- datasets.SplitGenerator(
49
- name=datasets.Split.TEST,
50
- gen_kwargs={"path": test_json},
51
- )
52
- ] + ([datasets.SplitGenerator(
53
- name=datasets.Split.VALIDATION,
54
- gen_kwargs={"path": valid_json},
55
- )] if self.config.name != "BillSum" else [])
56
-
57
- # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
58
- def _generate_examples(self, path):
59
- with open(path, encoding="utf-8") as f:
60
- for key, row in enumerate(f):
61
- yield key, json.loads(row)