Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unique column to output of the log_parsing pipeline #1795

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unused variables
  • Loading branch information
dagardner-nv committed Jul 3, 2024
commit f02c2715320506fc65fdd2511f27fa95a5d787ac
5 changes: 0 additions & 5 deletions examples/log_parsing/postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,14 @@ def _postprocess(self, x: MultiResponseMessage):
parsed_dfs = infer_pdf.apply(lambda row: self.__get_label_dicts(row), axis=1, result_type="expand")

ext_parsed = pd.DataFrame(parsed_dfs[0].tolist())
ext_confidence = pd.DataFrame(parsed_dfs[1].tolist())
parsed_df = pd.DataFrame()
confidence_df = pd.DataFrame()
ext_confidence = ext_confidence.applymap(np.mean)
for label in ext_parsed.columns:
if label[0] == "B":
col_name = label[2:]
if "I-" + col_name in ext_parsed.columns:
parsed_df[col_name] = ext_parsed[label] + " " + ext_parsed["I-" + col_name].fillna('')
confidence_df[col_name] = (ext_confidence[label] + ext_confidence[label]) / 2
else:
parsed_df[col_name] = ext_parsed[label]
confidence_df[col_name] = ext_confidence[label]

# decode cleanup
parsed_df = self.__decode_cleanup(parsed_df)
Expand Down