Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
asahi417 commited on
Commit
785cdc5
1 Parent(s): f752e34

Update t_rex.py

Browse files
Files changed (1) hide show
  1. t_rex.py +6 -20
t_rex.py CHANGED
@@ -19,15 +19,9 @@ _CITATION = """
19
 
20
  _HOME_PAGE = "https://github.com/asahi417/relbert"
21
  _URL = f'https://huggingface.co/datasets/relbert/{_NAME}/resolve/main/data'
22
- # MIN_ENTITY_FREQ = [1, 2, 3, 4]
23
- # MAX_PREDICATE_FREQ = [100, 50, 25, 10]
24
-
25
- # _TYPES = [f"filter_unified.min_entity_{a}_max_predicate_{b}" for a, b in product(MIN_ENTITY_FREQ, MAX_PREDICATE_FREQ)]
26
- # _TYPES += ["raw", "filter", "filter_unified"]
27
- # _NON_SPLITS = ["raw", "filter", "filter_unified"]
28
  _URLS = {
29
- str(datasets.Split.TRAIN): [f'{_URL}/t_rex.{i}.train.jsonl'],
30
- str(datasets.Split.VALIDATION): [f'{_URL}/t_rex.{i}.validation.jsonl'],
31
  str(datasets.Split.TEST): [f'{_URL}/t_rex.filter_unified.test.jsonl']
32
  }
33
 
@@ -46,19 +40,11 @@ class TREXConfig(datasets.BuilderConfig):
46
  class TREX(datasets.GeneratorBasedBuilder):
47
  """Dataset."""
48
 
49
- BUILDER_CONFIGS = [
50
- TREXConfig(name=i, version=datasets.Version(_VERSION), description=_DESCRIPTION)
51
- for i in sorted(_TYPES)
52
- ]
53
-
54
  def _split_generators(self, dl_manager):
55
- downloaded_file = dl_manager.download_and_extract(_URLS[self.config.name])
56
- if self.config.name in _NON_SPLITS:
57
- return [datasets.SplitGenerator(
58
- name=datasets.Split.TRAIN,
59
- gen_kwargs={"filepaths": downloaded_file[str(datasets.Split.TRAIN)]})]
60
- else:
61
- return [datasets.SplitGenerator(name=i, gen_kwargs={"filepaths": downloaded_file[str(i)]})
62
  for i in [datasets.Split.TRAIN, datasets.Split.VALIDATION, datasets.Split.TEST]]
63
 
64
  def _generate_examples(self, filepaths):
 
19
 
20
  _HOME_PAGE = "https://github.com/asahi417/relbert"
21
  _URL = f'https://huggingface.co/datasets/relbert/{_NAME}/resolve/main/data'
 
 
 
 
 
 
22
  _URLS = {
23
+ str(datasets.Split.TRAIN): [f'{_URL}/t_rex.filter_unified.train.jsonl'],
24
+ str(datasets.Split.VALIDATION): [f'{_URL}/t_rex.filter_unified.validation.jsonl'],
25
  str(datasets.Split.TEST): [f'{_URL}/t_rex.filter_unified.test.jsonl']
26
  }
27
 
 
40
  class TREX(datasets.GeneratorBasedBuilder):
41
  """Dataset."""
42
 
43
+ BUILDER_CONFIGS = [TREXConfig(name=_NAME), version=datasets.Version(_VERSION), description=_DESCRIPTION)]
44
+
 
 
 
45
  def _split_generators(self, dl_manager):
46
+ downloaded_file = dl_manager.download_and_extract(_URLS)
47
+ return [datasets.SplitGenerator(name=i, gen_kwargs={"filepaths": downloaded_file[str(i)]})
 
 
 
 
 
48
  for i in [datasets.Split.TRAIN, datasets.Split.VALIDATION, datasets.Split.TEST]]
49
 
50
  def _generate_examples(self, filepaths):