sameer505 commited on
Commit
bebb912
·
1 Parent(s): 49ba146

edited _split

Browse files
milling_processes_LUH__testing_propuses.py CHANGED
@@ -6,7 +6,6 @@ import os
6
 
7
  import datasets
8
 
9
- # TODO: Add BibTeX citation
10
  # Find for instance the citation on arxiv or on the dataset repo/website
11
  _CITATION = """\
12
  @InProceedings{huggingface:dataset,
@@ -110,24 +109,36 @@ class MillingProcessesLUH(datasets.GeneratorBasedBuilder):
110
  name=datasets.Split.TRAIN,
111
  # These kwargs will be passed to _generate_examples
112
  gen_kwargs={
113
- "filepath": os.path.join(data_dir, "train.jsonl"),
114
- "split": "train",
 
 
 
 
115
  },
116
  ),
117
  datasets.SplitGenerator(
118
  name=datasets.Split.VALIDATION,
119
  # These kwargs will be passed to _generate_examples
120
  gen_kwargs={
121
- "filepath": os.path.join(data_dir, "dev.jsonl"),
122
- "split": "dev",
 
 
 
 
 
123
  },
124
  ),
125
  datasets.SplitGenerator(
126
  name=datasets.Split.TEST,
127
  # These kwargs will be passed to _generate_examples
128
  gen_kwargs={
129
- "filepath": os.path.join(data_dir, "test.jsonl"),
130
- "split": "test"
 
 
 
131
  },
132
  ),
133
  ]
@@ -139,16 +150,25 @@ class MillingProcessesLUH(datasets.GeneratorBasedBuilder):
139
  with open(filepath, encoding="utf-8") as f:
140
  for key, row in enumerate(f):
141
  data = json.loads(row)
142
- if self.config.name == "first_domain":
143
- # Yields examples as (key, example) tuples
144
- yield key, {
145
- "sentence": data["sentence"],
146
- "option1": data["option1"],
147
- "answer": "" if split == "test" else data["answer"],
148
- }
149
- else:
150
- yield key, {
151
- "sentence": data["sentence"],
152
- "option2": data["option2"],
153
- "second_domain_answer": "" if split == "test" else data["second_domain_answer"],
154
- }
 
 
 
 
 
 
 
 
 
 
6
 
7
  import datasets
8
 
 
9
  # Find for instance the citation on arxiv or on the dataset repo/website
10
  _CITATION = """\
11
  @InProceedings{huggingface:dataset,
 
109
  name=datasets.Split.TRAIN,
110
  # These kwargs will be passed to _generate_examples
111
  gen_kwargs={
112
+ "p_data":urls,
113
+ "id_start":0,
114
+ "id_end":2
115
+
116
+ # "filepath": os.path.join(data_dir, "train.jsonl"),
117
+ # "split": "train",
118
  },
119
  ),
120
  datasets.SplitGenerator(
121
  name=datasets.Split.VALIDATION,
122
  # These kwargs will be passed to _generate_examples
123
  gen_kwargs={
124
+
125
+ "p_data":urls,
126
+ "id_start":2,
127
+ "id_end":3
128
+
129
+ # "filepath": os.path.join(data_dir, "dev.jsonl"),
130
+ # "split": "dev",
131
  },
132
  ),
133
  datasets.SplitGenerator(
134
  name=datasets.Split.TEST,
135
  # These kwargs will be passed to _generate_examples
136
  gen_kwargs={
137
+ "p_data":urls,
138
+ "id_start":3,
139
+ "id_end":4
140
+ # "filepath": os.path.join(data_dir, "test.jsonl"),
141
+ # "split": "test"
142
  },
143
  ),
144
  ]
 
150
  with open(filepath, encoding="utf-8") as f:
151
  for key, row in enumerate(f):
152
  data = json.loads(row)
153
+ # Yields examples as (key, example) tuples
154
+ yield key, {
155
+ "cumulated_tool_contact_time": data["cumulated_tool_contact_time"],
156
+ "machine": data["machine"],
157
+ "run": data["run"],
158
+ "tool": data["tool"],
159
+ "wear": data["wear"],
160
+ "position_control_deviation_axis_x": data["position_control_deviation_axis_x"],
161
+ "position_control_deviation_axis_y":data["position_control_deviation_axis_y"],
162
+ "time_machine": data["time_machine"],
163
+ "tool_position_x": data["tool_position_x"],
164
+ "tool_position_y": data["tool_position_y"],
165
+ "tool_position_z": data["tool_position_z"],
166
+ "torque_axis_x": data["torque_axis_x"],
167
+ "torque_axis_y": data["torque_axis_y"],
168
+ "torque_axis_z": data["torque_axis_z"],
169
+ "torque_spindle": data["torque_spindle"],
170
+ "force_sensor_x": data["force_sensor_x"],
171
+ "force_sensor_y": data["force_sensor_y"],
172
+ "force_sensor_z": data["force_sensor_z"],
173
+ "time_sensor": data["time_sensor"]
174
+ }