From 6a64d2b08557313bf121eeb231d6fdc4811e6585 Mon Sep 17 00:00:00 2001 From: vishnuszipstack <117254672+vishnuszipstack@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:02:33 +0530 Subject: [PATCH] added confidace score in metadata (#826) --- tools/structure/src/constants.py | 1 + tools/structure/src/main.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/structure/src/constants.py b/tools/structure/src/constants.py index ae5dfb133..0def2f8a1 100644 --- a/tools/structure/src/constants.py +++ b/tools/structure/src/constants.py @@ -72,4 +72,5 @@ class SettingsKeys: METADATA = "metadata" EPILOGUE = "epilogue" HIGHLIGHT_DATA = "highlight_data" + CONFIDENCE_DATA = "confidence_data" EXECUTION_RUN_DATA_FOLDER = "EXECUTION_RUN_DATA_FOLDER" diff --git a/tools/structure/src/main.py b/tools/structure/src/main.py index dfb71345f..58e8fbe2d 100644 --- a/tools/structure/src/main.py +++ b/tools/structure/src/main.py @@ -216,10 +216,16 @@ def run( epilogue = metadata.pop(SettingsKeys.EPILOGUE, None) if epilogue: try: - from helper import transform_dict # type: ignore [attr-defined] + from helper import ( # type: ignore [attr-defined] + get_confidence_data, + transform_dict, + ) highlight_data = transform_dict(epilogue, tool_data_dir) metadata[SettingsKeys.HIGHLIGHT_DATA] = highlight_data + metadata[SettingsKeys.CONFIDENCE_DATA] = get_confidence_data( + epilogue, tool_data_dir + ) except ImportError: self.stream_log( f"Highlight metadata is not added. {PAID_FEATURE_MSG}",