(self, line)
| 55 | |
| 56 | class WideDeepDatasetReader(fleet.MultiSlotDataGenerator): |
| 57 | def line_process(self, line): |
| 58 | dense = line["dense_feature"].numpy() |
| 59 | sparse = line["sparse_feature"].numpy() |
| 60 | label = [int(line["label"].numpy())] |
| 61 | |
| 62 | dense_array = (dense - cont_min_) / cont_diff_ |
| 63 | dense_feature = [float(i) for i in dense_array] |
| 64 | sparse_feature = [[hash(i) % hash_dim_] for i in sparse] |
| 65 | |
| 66 | return [dense_feature] + sparse_feature + [label] |
| 67 | |
| 68 | def generate_sample(self, line): |
| 69 | def wd_reader(): |