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

Merge branch 'master' into pre-training

parents 3e77b6dc f7fe7b49
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