convlab2.nlg.sclstm.multiwoz package¶
Submodules¶
convlab2.nlg.sclstm.multiwoz.evaluate module¶
Evaluate NLG models on utterances of Multiwoz test dataset Metric: dataset level BLEU-4, slot error rate Usage: python evaluate.py [usr|sys|all]
-
convlab2.nlg.sclstm.multiwoz.evaluate.
get_bleu4
(dialog_acts, golden_utts, gen_utts)¶
-
convlab2.nlg.sclstm.multiwoz.evaluate.
get_err_slot
(dialog_acts, gen_slots)¶
convlab2.nlg.sclstm.multiwoz.sc_lstm module¶
-
class
convlab2.nlg.sclstm.multiwoz.sc_lstm.
SCLSTM
(archive_file='/home/travis/build/thu-coai/ConvLab-2/convlab2/nlg/sclstm/multiwoz/models/nlg-sclstm-multiwoz.zip', use_cuda=False, is_user=False, model_file='https://convlab.blob.core.windows.net/convlab-2/nlg_sclstm_multiwoz.zip')¶ Bases:
convlab2.nlg.nlg.NLG
-
generate
(meta)¶ dialog_acts = [[intent, domain, slot, value], … ]] => meta = {“Attraction-Inform”: [[“Choice”,”many”],[“Area”,”centre of town”]],
“Attraction-Select”: [[“Type”,”church”],[“Type”,” swimming”],[“Type”,” park”]]}
-
generate_delex
(meta)¶
-
generate_slots
(meta)¶
-
-
convlab2.nlg.sclstm.multiwoz.sc_lstm.
parse
(is_user)¶
convlab2.nlg.sclstm.multiwoz.train module¶
-
convlab2.nlg.sclstm.multiwoz.train.
evaluate
(config, dataset, model, data_type, beam_search, beam_size, batch_size)¶
-
convlab2.nlg.sclstm.multiwoz.train.
get_slot_error
(dataset, gens, refs, sv_indexes)¶ - Args:
gens: (batch_size, beam_size) refs: (batch_size,) sv: (batch_size,)
- Returns:
count: accumulative slot error of a batch countPerGen: slot error for each sample
-
convlab2.nlg.sclstm.multiwoz.train.
interact
(config, args)¶
-
convlab2.nlg.sclstm.multiwoz.train.
parse
()¶
-
convlab2.nlg.sclstm.multiwoz.train.
read
(config, args, mode)¶
-
convlab2.nlg.sclstm.multiwoz.train.
score
(feat, gen, template)¶ feat = [‘d-a-s-v:Booking-Book-Day-1’, ‘d-a-s-v:Booking-Book-Name-1’, ‘d-a-s-v:Booking-Book-Name-2’] gen = ‘xxx slot-booking-book-name xxx slot-booking-book-time’
-
convlab2.nlg.sclstm.multiwoz.train.
str2bool
(v)¶
-
convlab2.nlg.sclstm.multiwoz.train.
test
(config, args)¶
-
convlab2.nlg.sclstm.multiwoz.train.
train
(config, args)¶
-
convlab2.nlg.sclstm.multiwoz.train.
train_epoch
(config, dataset, model)¶