ArneBinder commited on
Commit
dc0c501
1 Parent(s): e484998

sort file_names_filtered to get deterministic order of entries

Browse files
Files changed (1) hide show
  1. dialam2024.py +6 -5
dialam2024.py CHANGED
@@ -27,7 +27,6 @@ import os
27
  import datasets
28
  from datasets import Features, GeneratorBasedBuilder
29
 
30
-
31
  logger = logging.getLogger(__name__)
32
 
33
  DATA_URL = "http://dialam.arg.tech/res/files/dataset.zip"
@@ -143,13 +142,14 @@ def get_node_id_from_filename(filename: str) -> str:
143
  """Get the ID of a nodeset from a filename."""
144
 
145
  return filename.split("nodeset")[1].split(".json")[0]
146
-
147
 
148
- class DialAM2024(GeneratorBasedBuilder):
149
 
 
150
  BUILDER_CONFIGS = [
151
  datasets.BuilderConfig(
152
- name="dialam_2024", version=datasets.Version("1.0.0"), description="DialAM-2024 dataset"
 
 
153
  ),
154
  ]
155
 
@@ -202,7 +202,8 @@ class DialAM2024(GeneratorBasedBuilder):
202
  data_dir = os.path.abspath(dl_manager.manual_dir)
203
  # collect all json files in the data_dir with glob
204
  file_names = glob.glob(os.path.join(data_dir, "*.json"))
205
- file_names_filtered = [fn for fn in file_names if not is_blacklisted(fn)]
 
206
  return [
207
  datasets.SplitGenerator(
208
  name=datasets.Split.TRAIN,
 
27
  import datasets
28
  from datasets import Features, GeneratorBasedBuilder
29
 
 
30
  logger = logging.getLogger(__name__)
31
 
32
  DATA_URL = "http://dialam.arg.tech/res/files/dataset.zip"
 
142
  """Get the ID of a nodeset from a filename."""
143
 
144
  return filename.split("nodeset")[1].split(".json")[0]
 
145
 
 
146
 
147
+ class DialAM2024(GeneratorBasedBuilder):
148
  BUILDER_CONFIGS = [
149
  datasets.BuilderConfig(
150
+ name="dialam_2024",
151
+ version=datasets.Version("1.0.0"),
152
+ description="DialAM-2024 dataset",
153
  ),
154
  ]
155
 
 
202
  data_dir = os.path.abspath(dl_manager.manual_dir)
203
  # collect all json files in the data_dir with glob
204
  file_names = glob.glob(os.path.join(data_dir, "*.json"))
205
+ # filter out blacklisted nodesets and sort to get deterministic order
206
+ file_names_filtered = sorted([fn for fn in file_names if not is_blacklisted(fn)])
207
  return [
208
  datasets.SplitGenerator(
209
  name=datasets.Split.TRAIN,