Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

added confidace score in metadata (#826)

vishnuszipstack6a64d2b08557
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 @@ class StructureTool(BaseTool):
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}",