Skip to content
Snippets Groups Projects
Commit d71de0fa authored by zqwerty's avatar zqwerty
Browse files

fix bug in bertnlu nlu.py: spacy tokenizer

parent 12a1da7a
No related branches found
No related tags found
No related merge requests found
......@@ -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."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment