convlab2.nlu.svm.multiwoz package¶
Submodules¶
convlab2.nlu.svm.multiwoz.evaluate module¶
Evaluate SVMNLU models on Multiwoz test dataset
- Metric:
dataset level Precision/Recall/F1
- Usage:
PYTHONPATH=../../../.. python evaluate.py [usr|sys|all]
-
convlab2.nlu.svm.multiwoz.evaluate.
da2triples
(dialog_act)¶
convlab2.nlu.svm.multiwoz.nlu module¶
SVMNLU build a classifier for each semantic tuple (intent-slot-value) based on n-gram features. It’s first proposed by Mairesse et al. (2009). We adapt the implementation from pydial.
For more information, please refer to convlab2/nlu/svm/multiwoz/README.md
Trained models can be download on:
https://convlab.blob.core.windows.net/convlab-2/svm_multiwoz_all.zip
https://convlab.blob.core.windows.net/convlab-2/svm_multiwoz_sys.zip
https://convlab.blob.core.windows.net/convlab-2/svm_multiwoz_usr.zip
Reference:
Mairesse, F., Gasic, M., Jurcicek, F., Keizer, S., Thomson, B., Yu, K., & Young, S. (2009, April). Spoken language understanding from unaligned data using discriminative classification models. In 2009 IEEE International Conference on Acoustics, Speech and Signal Processing (pp. 4749-4752). IEEE.
-
class
convlab2.nlu.svm.multiwoz.nlu.
SVMNLU
(mode='all')¶ Bases:
convlab2.nlu.nlu.NLU
-
predict
(utterance, context=[])¶ Predict the dialog act of a natural language utterance.
- Args:
- utterance (str):
A natural language utterance.
- Returns:
- output (dict):
The dialog act of utterance.
-
convlab2.nlu.svm.multiwoz.preprocess module¶
Preprocess multiwoz data for SVMNLU.
- Usage:
python preprocess [mode=all|usr|sys] mode: which side data will be use
- Require:
../../../../data/multiwoz/[train|val|test].json.zip
data file../../../../data/multiwoz/db
database dir
- Output:
configs/ontology_multiwoz_[mode].json
ontology filedata/[mode]_data/
processed data dir
-
convlab2.nlu.svm.multiwoz.preprocess.
read_zipped_json
(filepath, filename)¶