Skip to content

Commit

Permalink
V7+ changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bakhatar authored Mar 7, 2024
1 parent 6fd1d83 commit 980faea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down
7 changes: 4 additions & 3 deletions actions/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 980faea

Please sign in to comment.