Esempio n. 1
0
# load the user goals from .p file
all_goal_set = pickle.load(open(goal_file_path, 'rb'))

# split goal set
split_fold = params.get('split_fold', 5)
goal_set = {'train': [], 'valid': [], 'test': [], 'all': []}
for u_goal_id, u_goal in enumerate(all_goal_set):
    if u_goal_id % split_fold == 1: goal_set['test'].append(u_goal)
    else: goal_set['train'].append(u_goal)
    goal_set['all'].append(u_goal)
# end split goal set

kb_path = params['kb_path']
kb = pickle.load(open(kb_path, 'rb'))

act_set = text_to_dict(params['act_set'])
slot_set = text_to_dict(params['slot_set'])

################################################################################
# a movie dictionary for user simulator - slot:possible values
################################################################################
movie_dictionary = pickle.load(open(dict_path, 'rb'))

dialog_config.run_mode = params['run_mode']
dialog_config.auto_suggest = params['auto_suggest']

################################################################################
#   Parameters for Agents
################################################################################
agent_params = {}
agent_params['max_turn'] = max_turn
Esempio n. 2
0
train_user_goals = pickle.load(open(train_user_goals_file_path, 'rb'))
# split the training user goals in sets with request and without request slots
train_user_goals_no_req_slots, train_user_goals_with_req_slots = split_user_goals(train_user_goals)


# the path to the full set of testing goals
test_user_goals_file_path = "./deep_dialog/data/user_test_goals.p"
# read all test user goals
test_user_goals = pickle.load(open(test_user_goals_file_path, 'rb'))

################################################################################
# Set of Dialogue Acts and Slot Types
################################################################################

act_set_file_path = "./deep_dialog/data/dia_acts.txt"
act_set = text_to_dict(act_set_file_path)

slot_set_file_path = "./deep_dialog/data/slot_set.txt"
slot_set = text_to_dict(slot_set_file_path)

################################################################################
#   Knowledge Base
################################################################################

# Knowledge Base Path
kb_path = "./deep_dialog/data/rest_kb.p"
# load the knowledge base
kb = pickle.load(open(kb_path, 'rb'))

################################################################################
#  Create the both Agents: pretrained and not pretrained