95 header = json.loads(line)
96 tensor_specs = [TensorSpec.from_dict(ts)
for ts
in header[
"features"]]
97 score_spec = TensorSpec.from_dict(header[
"score"])
if "score" in header
else None
98 advice_spec = TensorSpec.from_dict(header[
"advice"])
if "advice" in header
else None
99 return tensor_specs, score_spec, advice_spec
117 with io.BufferedReader(io.FileIO(fname,
"rb"))
as f:
121 event_str = f.readline()
125 context, event_str, f, tensor_specs, score_spec
127 yield context, observation_id, features, score
139 context,
"", f, tensor_specs, score_spec
141 yield context, observation_id, features, score