convlab2.nlu.jointBERT.crosswoz package¶
Submodules¶
convlab2.nlu.jointBERT.crosswoz.analyse module¶
-
convlab2.nlu.jointBERT.crosswoz.analyse.
calculateF1
(predict_golden, goal_type=None, intent=None, domain=None, slot=None)¶
-
convlab2.nlu.jointBERT.crosswoz.analyse.
get_goal_type
(data, mode)¶
-
convlab2.nlu.jointBERT.crosswoz.analyse.
read_zipped_json
(filepath, filename)¶
convlab2.nlu.jointBERT.crosswoz.nlu module¶
-
class
convlab2.nlu.jointBERT.crosswoz.nlu.
BERTNLU
(mode='all', config_file='crosswoz_all_context.json', model_file='https://convlab.blob.core.windows.net/convlab-2/bert_crosswoz_all_context.zip')¶ Bases:
convlab2.nlu.nlu.NLU
-
predict
(utterance, context=[])¶ Predict the dialog act of a natural language utterance.
- Args:
- utterance (str):
A natural language utterance.
- context (list of str):
Previous utterances.
- Returns:
- action (list of list):
The dialog act of utterance.
-
convlab2.nlu.jointBERT.crosswoz.postprocess module¶
-
convlab2.nlu.jointBERT.crosswoz.postprocess.
calculateF1
(predict_golden)¶
-
convlab2.nlu.jointBERT.crosswoz.postprocess.
intent2das
(intent_seq)¶
-
convlab2.nlu.jointBERT.crosswoz.postprocess.
is_slot_da
(da)¶
-
convlab2.nlu.jointBERT.crosswoz.postprocess.
recover_intent
(dataloader, intent_logits, tag_logits, tag_mask_tensor, ori_word_seq, new2ori)¶
-
convlab2.nlu.jointBERT.crosswoz.postprocess.
tag2das
(word_seq, tag_seq)¶
convlab2.nlu.jointBERT.crosswoz.preprocess module¶
-
convlab2.nlu.jointBERT.crosswoz.preprocess.
preprocess
(mode)¶
-
convlab2.nlu.jointBERT.crosswoz.preprocess.
read_zipped_json
(filepath, filename)¶