From 980faea579af626143d8b7ac916145db35561544 Mon Sep 17 00:00:00 2001 From: bakhatar <122284231+bakhatar@users.noreply.github.com> Date: Thu, 7 Mar 2024 12:05:53 +0100 Subject: [PATCH] V7+ changes --- actions/actions.py | 2 ++ actions/functions.py | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/actions/actions.py b/actions/actions.py index d3ad2a6..3f47aab 100644 --- a/actions/actions.py +++ b/actions/actions.py @@ -10,6 +10,7 @@ from rasa_sdk.events import SlotSet from rasa_sdk import FormValidationAction from rasa_sdk.types import DomainDict + import random from datetime import datetime import pandas as pd @@ -19,6 +20,7 @@ # load static data from file # js_pth='mydata/static_data.json' js_pth='/app/actions/mydata/static_data.json' + definitions_dict, module_titles,choose_qst_variations,definitions_dict_old,other_qst_variations= load_data_from_file(js_pth) class ActionStopNavigation(Action): diff --git a/actions/functions.py b/actions/functions.py index 0417d84..f86a9a3 100644 --- a/actions/functions.py +++ b/actions/functions.py @@ -5,8 +5,9 @@ import pandas as pd print("############################# IMPORTING UTILS") -# data_path="mydata/Base_RGPH24V7_all_ID" -data_path="/app/actions/mydata/Base_RGPH24V7_all_ID" +# data_path="mydata/Base_RGPH24V7+_all_ID" +data_path="/app/actions/mydata/Base_RGPH24V7+_all_ID" + print('################################## actions run using', data_path ) df=pd.read_excel(data_path +'.xlsx') @@ -134,7 +135,7 @@ def module_recommendations(df_rslt,n=n_module): ##new -def situation_recommendations(df_rslt, module_id, n=n_situation, nan_id=4): +def situation_recommendations(df_rslt, module_id, n=n_situation, nan_id=16): # Filter the DataFrame and get unique situation IDs, excluding nan_id filtered_situation_ids = df_rslt[(df_rslt['module_ID'] == int(module_id)) & (df_rslt['situation_ID'] != nan_id)]['situation_ID'].unique() # Limit the number of situation IDs to n