convlab2.policy.vhus.multiwoz package¶
Submodules¶
convlab2.policy.vhus.multiwoz.train module¶
@author: truthless
convlab2.policy.vhus.multiwoz.usermanager module¶
@author: keshuichonglx
-
class
convlab2.policy.vhus.multiwoz.usermanager.
UserDataManager
¶ Bases:
object
-
static
da_dict_form_to_list_form
(da)¶ convert da in dict form to da in list form for example, {‘restaurant-inform’: [[‘area’, ‘west’], [‘price’, ‘cheap’]]} ->
[[‘Inform’, ‘Restaurant’, ‘Area’, ‘west’], [‘Inform’, ‘Restaurant’, ‘Price’, ‘cheap’]]
-
static
da_list_form_to_dict_form
(da)¶ convert the da in list form to da in dict form for example, [[‘Inform’, ‘Train’, ‘Leave’, ‘09:00’]] -> {‘train-inform’: [[‘leave’, ‘09:00’]]}
-
data_loader
()¶
-
data_loader_seg
()¶
-
get_goal_id
(goal)¶
-
get_sysda_id
(sys_das)¶
-
get_usrda_id
(usr_das)¶
-
get_voc_size
()¶
-
id2sentence
(ids)¶
-
org_data_loader
()¶
-
static
query_goal_for_sys
(domain, slot, value, goal)¶
-
static
query_goal_for_usr
(domain, slot, value, goal)¶
-
static
ref_data2stand
(da)¶
-
static
train_test_val_split
(goals, usr_dass, sys_dass, test_size=0.1, val_size=0.1)¶
-
static
train_test_val_split_seg
(goals_seg, usr_dass_seg, sys_dass_seg, test_size=0.1, val_size=0.1)¶
-
vocab_loader
()¶
-
static
convlab2.policy.vhus.multiwoz.vhus module¶
-
class
convlab2.policy.vhus.multiwoz.vhus.
UserPolicyVHUS
(load_from_zip=False, archive_file='/home/travis/build/thu-coai/ConvLab-2/convlab2/policy/vhus/multiwoz/models/vhus_simulator_multiwoz.zip', model_file='https://convlab.blob.core.windows.net/convlab-2/vhus_simulator_multiwoz.zip')¶ Bases:
convlab2.policy.vhus.vhus.UserPolicyVHUSAbstract
-
predict
(state)¶ Predict an user act based on state and preorder system action.
- Args:
- state (tuple):
Dialog state.
- Returns:
- usr_action (tuple):
User act.
- session_over (boolean):
True to terminate session, otherwise session continues.
-