MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / parse_csv

Function parse_csv

modelzoo/dssm/train.py:268–279  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

266# generate dataset pipline
267def build_model_input(filename, batch_size, num_epochs):
268 def parse_csv(value):
269 tf.logging.info('Parsing {}'.format(filename))
270 string_defaults = [[' '] for i in range(1, 19)]
271 label_defaults = [[0], [0]]
272 column_headers = INPUT_COLUMN
273 record_defaults = label_defaults + string_defaults
274 columns = tf.io.decode_csv(value, record_defaults=record_defaults)
275 all_columns = collections.OrderedDict(zip(column_headers, columns))
276 labels = all_columns.pop(LABEL_COLUMN[0])
277 all_columns.pop(BUY_COLUMN[0])
278 features = all_columns
279 return features, labels
280
281 def parse_parquet(value):
282 tf.logging.info('Parsing {}'.format(filename))

Callers

nothing calls this directly

Calls 4

infoMethod · 0.80
rangeFunction · 0.50
formatMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected