From 3f2b7231fd058117ab806bee78741f71e2a3465f Mon Sep 17 00:00:00 2001 From: Daksh Date: Mon, 26 Oct 2020 10:21:39 +0100 Subject: [PATCH 1/2] change the default model name --- docs/docs/components.mdx | 4 ++-- rasa/nlu/utils/hugging_face/registry.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/components.mdx b/docs/docs/components.mdx index d94ad71cf26a..bbb2bf9b388f 100644 --- a/docs/docs/components.mdx +++ b/docs/docs/components.mdx @@ -187,7 +187,7 @@ word vectors in your pipeline. | Language Model | Parameter | Default value for | | | "model_name" | "model_weights" | +----------------+--------------+-------------------------+ - | BERT | bert | bert-base-uncased | + | BERT | bert | rasa/LaBSE | +----------------+--------------+-------------------------+ | GPT | gpt | openai-gpt | +----------------+--------------+-------------------------+ @@ -209,7 +209,7 @@ word vectors in your pipeline. # Name of the language model to use model_name: "bert" # Pre-Trained weights to be loaded - model_weights: "bert-base-uncased" + model_weights: "rasa/LaBSE" # An optional path to a specific directory to download and cache the pre-trained model weights. # The `default` cache_dir is the same as https://huggingface.co/transformers/serialization.html#cache-directory . diff --git a/rasa/nlu/utils/hugging_face/registry.py b/rasa/nlu/utils/hugging_face/registry.py index a6d68cde8747..65bbc67235d1 100644 --- a/rasa/nlu/utils/hugging_face/registry.py +++ b/rasa/nlu/utils/hugging_face/registry.py @@ -55,7 +55,7 @@ "roberta": RobertaTokenizer, } model_weights_defaults = { - "bert": "bert-base-uncased", + "bert": "rasa/LaBSE", "gpt": "openai-gpt", "gpt2": "gpt2", "xlnet": "xlnet-base-cased", From aefd118a973860be6ccc52c60c732577fe1306a8 Mon Sep 17 00:00:00 2001 From: Daksh Date: Mon, 26 Oct 2020 10:32:36 +0100 Subject: [PATCH 2/2] add changelog --- changelog/7102.improvement.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelog/7102.improvement.md diff --git a/changelog/7102.improvement.md b/changelog/7102.improvement.md new file mode 100644 index 000000000000..6b8c393e6691 --- /dev/null +++ b/changelog/7102.improvement.md @@ -0,0 +1,5 @@ +Changed the default model weights loaded for `HFTransformersNLP` component. + +Use a [language agnostic sentence embedding model](https://tfhub.dev/google/LaBSE/1) +as the default model. These model weights should help improve performance on +intent classification and response selection. \ No newline at end of file