convlab2.dst package

Submodules

convlab2.dst.dst module

Dialog State Tracker Interface

class convlab2.dst.dst.DST

Bases: convlab2.util.module.Module

DST module interface.

from_cache(*args, **kwargs)

restore internal state for multi-turn dialog

to_cache(*args, **kwargs)

save internal state for multi-turn dialog

update(action)

Update the internal dialog state variable.

Args:
action (str or list of list):

The type is str when DST is word-level (such as NBT), and list of list when it is DA-level.

Returns:
new_state (dict):

Updated dialog state, with the same form of previous state.

update_turn(sys_utt, user_utt)

Update the internal dialog state variable with .

Args:
sys_utt (str):

system utterance of current turn, set to None for the first turn

user_utt (str):

user utterance of current turn

Returns:
new_state (dict):

Updated dialog state, with the same form of previous state.

convlab2.dst.evaluate module

Evaluate DST models on specified dataset Usage: python evaluate.py [MultiWOZ|CrossWOZ|MultiWOZ-zh|CrossWOZ-en] [TRADE|mdbt|sumbt] [val|test|human_val]

convlab2.dst.evaluate.compute_acc(gold, pred, slot_temp)
convlab2.dst.evaluate.compute_prf(gold, pred)
convlab2.dst.evaluate.evaluate_metrics(all_prediction, from_which, slot_temp)
convlab2.dst.evaluate.format_history(context)
convlab2.dst.evaluate.reformat_state(state)
convlab2.dst.evaluate.reformat_state_crosswoz(state)
convlab2.dst.evaluate.sentseg(sent)

Module contents