You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# parse the dictionary into three dictionaries, one for each category [input, label, meta]
45
-
input_data, label_data, meta_data= {}, {}, {}
46
-
forkeyindata:
47
-
name, category, data_type=key.split(":")
48
-
ifcategory.lower() =="input":
49
-
input_data[f"{name}:{data_type}"] =data[key]
50
-
elifcategory.lower() =="label":
51
-
label_data[f"{name}:{data_type}"] =data[key]
52
-
elifcategory.lower() =="meta":
53
-
meta_data[f"{name}:{data_type}"] =data[key]
54
-
else:
55
-
raiseValueError(f"Unknown category {category}, category (the second element of the csv column, seperated by ':') should be input, label or meta. The specified csv column is {key}.")
raiseValueError(f"The split value {split} is not present in the column split:meta:int. The available values are {data['split:meta:int'].unique().to_list()}")
# parse the dictionary into three dictionaries, one for each category [input, label, meta]
117
+
input_data, label_data, meta_data= {}, {}, {}
118
+
forkeyindata:
119
+
name, category, data_type=key.split(":")
120
+
ifcategory.lower() =="input":
121
+
input_data[f"{name}:{data_type}"] =data[key]
122
+
elifcategory.lower() =="label":
123
+
label_data[f"{name}:{data_type}"] =data[key]
124
+
elifcategory.lower() =="meta":
125
+
meta_data[f"{name}:{data_type}"] =data[key]
126
+
else:
127
+
raiseValueError(f"Unknown category {category}, category (the second element of the csv column, seperated by ':') should be input, label or meta. The specified csv column is {key}.")
128
+
returninput_data, label_data, meta_data
129
+
130
+
def__getitem__(self, idx: Any) ->dict:
108
131
"""
109
132
It gets the data at a given index, and encodes the input and label, leaving meta as it is.
0 commit comments