From 7b5f54af1f7f820c49e95d2f784a53f886df6988 Mon Sep 17 00:00:00 2001 From: David Gardner Date: Thu, 31 Oct 2024 16:43:39 -0700 Subject: [PATCH] Fix applying seq_ids to start/stop cols --- examples/log_parsing/postprocessing.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/log_parsing/postprocessing.py b/examples/log_parsing/postprocessing.py index a63f2d1461..1e4d89689c 100644 --- a/examples/log_parsing/postprocessing.py +++ b/examples/log_parsing/postprocessing.py @@ -87,9 +87,8 @@ def _postprocess(self, msg: ControlMessage): src_index = src_df.index.to_pandas() seq_ids = msg.tensors().get_tensor('seq_ids').get() + infer_pdf = pd.DataFrame({"doc": src_index, "start": seq_ids[:, 1], "stop": seq_ids[:, 2]}) - infer_pdf = pd.DataFrame({"doc": src_index, "start": seq_ids[:, 0], "stop": seq_ids[:, 1]}) - infer_pdf.columns = ["doc", "start", "stop"] infer_pdf["confidences"] = msg.tensors().get_tensor('confidences').tolist() infer_pdf["labels"] = msg.tensors().get_tensor('labels').tolist() infer_pdf["token_ids"] = msg.tensors().get_tensor('input_ids').tolist()