convlab2.dst.sumbt.multiwoz package¶
Submodules¶
convlab2.dst.sumbt.multiwoz.convert_to_glue_format module¶
-
convlab2.dst.sumbt.multiwoz.convert_to_glue_format.
convert_to_glue_format
(data_dir, sumbt_dir)¶
convlab2.dst.sumbt.multiwoz.sumbt module¶
-
class
convlab2.dst.sumbt.multiwoz.sumbt.
SUMBTTracker
(data_dir='/home/travis/build/thu-coai/ConvLab-2/data/multiwoz', model_file='https://convlab.blob.core.windows.net/convlab-2/sumbt.tar.gz', eval_slots=['attraction-area', 'attraction-name', 'attraction-type', 'hotel-day', 'hotel-people', 'hotel-stay', 'hotel-area', 'hotel-internet', 'hotel-name', 'hotel-parking', 'hotel-pricerange', 'hotel-stars', 'hotel-type', 'restaurant-day', 'restaurant-people', 'restaurant-time', 'restaurant-area', 'restaurant-food', 'restaurant-name', 'restaurant-pricerange', 'taxi-arriveby', 'taxi-departure', 'taxi-destination', 'taxi-leaveat', 'train-people', 'train-arriveby', 'train-day', 'train-departure', 'train-destination', 'train-leaveat'])¶ Bases:
convlab2.dst.dst.DST
Transferable multi-domain dialogue state tracker, adopted from https://github.com/SKTBrain/SUMBT
-
construct_query
(context)¶ Construct query from context
-
detect_requestable_slots
(observation)¶
-
download_model
()¶
-
init_session
()¶ Init the class variables for a new session.
-
load_weights
(model_path=None)¶
-
predict
(query)¶
-
test
(mode='dev', model_path=None)¶ Testing funciton of TRADE (to be added)
-
train
(load_model=False, model_path=None)¶ Model training entry point
-
update
(user_act=None)¶ Update the dialogue state with the generated tokens from TRADE
-
-
convlab2.dst.sumbt.multiwoz.sumbt.
get_label_embedding
(labels, max_seq_length, tokenizer, device)¶
-
convlab2.dst.sumbt.multiwoz.sumbt.
test_update
()¶
-
convlab2.dst.sumbt.multiwoz.sumbt.
test_update_bak
()¶
convlab2.dst.sumbt.multiwoz.sumbt_config module¶
convlab2.dst.sumbt.multiwoz.sumbt_utils module¶
-
class
convlab2.dst.sumbt.multiwoz.sumbt_utils.
DataProcessor
¶ Bases:
object
Base class for data converters for sequence classification data sets.
-
get_labels
()¶ Gets the list of labels for this data set.
-
-
class
convlab2.dst.sumbt.multiwoz.sumbt_utils.
InputExample
(guid, text_a, text_b=None, label=None)¶ Bases:
object
A single training/test example for simple sequence classification.
-
class
convlab2.dst.sumbt.multiwoz.sumbt_utils.
InputFeatures
(input_ids, input_len, label_id)¶ Bases:
object
A single set of features of data.
-
class
convlab2.dst.sumbt.multiwoz.sumbt_utils.
Processor
(config)¶ Bases:
convlab2.dst.sumbt.multiwoz.sumbt_utils.DataProcessor
Processor for the belief tracking dataset (GLUE version).
-
get_dev_examples
(data_dir, accumulation=False)¶ See base class.
-
get_labels
()¶ See base class.
-
get_test_examples
(data_dir, accumulation=False)¶ See base class.
-
get_train_examples
(data_dir, accumulation=False)¶ See base class.
-
-
convlab2.dst.sumbt.multiwoz.sumbt_utils.
convert_examples_to_features
(examples, label_list, max_seq_length, tokenizer, max_turn_length)¶ Loads a data file into a list of `InputBatch`s.
-
convlab2.dst.sumbt.multiwoz.sumbt_utils.
eval_all_accs
(pred_slot, labels, accuracies)¶
-
convlab2.dst.sumbt.multiwoz.sumbt_utils.
get_label_embedding
(labels, max_seq_length, tokenizer, device)¶
-
convlab2.dst.sumbt.multiwoz.sumbt_utils.
insertSpace
(token, text)¶
-
convlab2.dst.sumbt.multiwoz.sumbt_utils.
normalize_text
(text)¶
-
convlab2.dst.sumbt.multiwoz.sumbt_utils.
warmup_linear
(x, warmup=0.002)¶