Delete loading script
Browse files- wikifact.py +0 -54
wikifact.py
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
import datasets
|
2 |
-
import os
|
3 |
-
import json
|
4 |
-
|
5 |
-
|
6 |
-
_CITATION = """
|
7 |
-
|
8 |
-
"""
|
9 |
-
|
10 |
-
_DESCRIPTION = """
|
11 |
-
|
12 |
-
"""
|
13 |
-
|
14 |
-
names = ['genre', 'instrument', 'author', 'creator', 'composer', 'director', 'applies_to_jurisdiction', 'overrules', 'laws_applied', 'repealed_by', 'majority_opinion_by', 'plaintiff', 'defendant', 'movement', 'influenced_by', 'member_of_political_party', 'diplomatic_relation', 'position_held', 'basic_form_of_government', 'office_held_by_head_of_state', 'head_of_state', 'office_held_by_head_of_government', 'head_of_government', 'shares_border_with', 'continent', 'capital', 'capital_of', 'country', 'twinned_administrative_body', 'currency', 'central_bank', 'subsidiary', 'stock_exchange', 'industry', 'statement_describes', 'solved_by', 'programming_language', 'operating_system', 'measured_physical_quantity', 'recommended_unit_of_measurement', 'discoverer_or_inventor', 'location_of_discovery', 'medical_condition_treated', 'drug_or_therapy_used_for_treatment', 'genetic_association', 'therapeutic_area', 'symptoms_and_signs', 'place_of_birth', 'place_of_death', 'subclass_of', 'official_language', 'position_played_on_team', 'member_of_sports_team', 'award_received', 'original_network', 'educated_at', 'named_after', 'original_language_of_film_or_TV_show', 'member_of', 'field_of_work', 'participating_team', 'occupation', 'has_part', 'manufacturer', 'developer', 'country_of_citizenship', 'language_of_work_or_name', 'located_in_the_administrative_territorial_entity', 'languages_spoken_written_or_signed', 'employer', 'record_label', 'location', 'work_location', 'religion', 'owned_by', 'native_language', 'instance_of', 'country_of_origin', 'headquarters_location', 'location_of_formation', 'part_of']
|
15 |
-
|
16 |
-
class Builder(datasets.GeneratorBasedBuilder):
|
17 |
-
VERSION = datasets.Version("1.0.0")
|
18 |
-
|
19 |
-
BUILDER_CONFIGS = [
|
20 |
-
datasets.BuilderConfig(name=name, version=datasets.Version("1.0.0"), description=_DESCRIPTION)
|
21 |
-
for name in names
|
22 |
-
]
|
23 |
-
|
24 |
-
def _info(self):
|
25 |
-
features = datasets.Features(
|
26 |
-
{
|
27 |
-
"question": datasets.Value("string"),
|
28 |
-
"references": datasets.Sequence(datasets.Value("string")),
|
29 |
-
}
|
30 |
-
)
|
31 |
-
return datasets.DatasetInfo(
|
32 |
-
description=_DESCRIPTION,
|
33 |
-
features=features,
|
34 |
-
homepage="",
|
35 |
-
license="",
|
36 |
-
citation=_CITATION,
|
37 |
-
)
|
38 |
-
|
39 |
-
def _split_generators(self, dl_manager):
|
40 |
-
train_json = dl_manager.download(os.path.join(self.config.name, "train.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.TEST,
|
46 |
-
gen_kwargs={"path": test_json},
|
47 |
-
),
|
48 |
-
]
|
49 |
-
|
50 |
-
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
51 |
-
def _generate_examples(self, path):
|
52 |
-
with open(path, encoding="utf-8") as f:
|
53 |
-
for key, row in enumerate(f):
|
54 |
-
yield key, json.loads(row)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|