From 3835057df8af0e557b14afa462469111ea453c94 Mon Sep 17 00:00:00 2001 From: Dayenne Souza Date: Wed, 17 Apr 2024 15:49:40 -0300 Subject: [PATCH] add fix protected mode on RM --- app/workflows/record_matching/workflow.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/workflows/record_matching/workflow.py b/app/workflows/record_matching/workflow.py index 4189ae15..fdbe1c6b 100644 --- a/app/workflows/record_matching/workflow.py +++ b/app/workflows/record_matching/workflow.py @@ -335,6 +335,12 @@ def att_ui(i): prefix = prefix + response + '\n' result = prefix.replace('```\n', '').strip() + + if sv_home.protected_mode.value: + unique_names = sv.matching_matches_df.value['Entity name'].unique() + for i, name in enumerate(unique_names, start=1): + result = result.replace(name, 'Entity_{}'.format(i)) + sv.matching_evaluations.value = pl.read_csv(io.StringIO(result), read_csv_options={"truncate_ragged_lines": True}) validation, messages_to_llm = util.ui_components.validate_ai_report(messages, sv.matching_evaluations.value)