From d71de0fa6e4a13137ad19ce10aa3bbf84dd3a975 Mon Sep 17 00:00:00 2001 From: zqwerty <zhuq96@hotmail.com> Date: Thu, 5 May 2022 11:11:32 +0800 Subject: [PATCH] fix bug in bertnlu nlu.py: spacy tokenizer --- convlab2/nlu/jointBERT/multiwoz/nlu.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/convlab2/nlu/jointBERT/multiwoz/nlu.py b/convlab2/nlu/jointBERT/multiwoz/nlu.py index 07aff59a..8f998651 100755 --- a/convlab2/nlu/jointBERT/multiwoz/nlu.py +++ b/convlab2/nlu/jointBERT/multiwoz/nlu.py @@ -61,7 +61,6 @@ class BERTNLU(NLU): self.model = model self.use_context = config['model']['context'] self.dataloader = dataloader - self.nlp = spacy.load('en_core_web_sm') try: self.nlp = spacy.load("en_core_web_sm") except Exception: @@ -121,7 +120,7 @@ class BERTNLU(NLU): if __name__ == '__main__': text = "How about rosa's bed and breakfast ? Their postcode is cb22ha." - nlu = BERTNLU(mode='sys', config_file='multiwoz_sys_context.json', + nlu = BERTNLU(mode='all', config_file='multiwoz_all_context.json', model_file='https://convlab.blob.core.windows.net/convlab-2/bert_multiwoz_all_context.zip') print(nlu.predict(text)) # text = "I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant.I don't care about the Price of the restaurant." -- GitLab