New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to add google's bert as a new feature #1754
Comments
Can you explain further and perhaps share some part of your work ? Do you apply Bert on Intent classification or Entity extraction or something else? |
I apply Bert on Intent classification, work language is chinese |
did u append the word vector of each token from Bert to the Featurization ? |
Hi @winstarwang we're currently playing around with it ourselves actually, thanks for the suggestion. There's a branch called |
yes |
Thanks very much! I will try it later |
@winstarwang We've added a BERT component in our component suite if you want to check it out. |
@blakeandrewwood thanks very much,I will try it later. |
awesome work @blakeandrewwood! |
@blakeandrewwood can you remove the dependence on "bert_tfhub_module_handle", I try it failed with the inaccessible |
Any update on this? I looked at the |
yeah it's based off of my/rasas fork of the repo. Honestly right now we're not convinced we should be adding it to the repository given inference time is very long and performance improvement isn't huge. But we're still running a few more experiments and will let you know |
Thanks I will take a look at the fork! |
I would also suggest looking at this repo: https://github.com/hanxiao/bert-as-service |
yeah we looked into that repo, it seems to require an insane amount of computing power though, so for us it was simpler to just use the existing code |
For people wondering what the numbers are for inference time. I ran a few tests on one of our models:
|
I have made a clone of rasa-nlu-0.14.4 and add bert feature. If someone has interest with it, you can go to https://github.com/winstarwang/rasa_nlu_bert |
do you use the presist() and load() ? |
@winstarwang no I didn't, which would explain the 13 seconds! I looked over your code and I will set it up and run a few tests and get back with the results. |
which environment did you run this? have seen bert standalone executing around 0.5 seconds on cpu. |
Hi @winstarwang I looked at your repo and set it up..Can you please advise as to how should I go about training the bert module in your repo.I just trained google bert model using this link |
hi @akelad ..I just trained a model using google bert and and another model using RASA.I used the exactly same dataset for training in both the models.I can defnitely tell you that google bert is working like a charm and predicting intents perfectly whereas RASA is going haywire on many of the sentences that I give it for predicting intents(I used tensorflow embedding pipeline in RASA). Although I am in the process of integrating bert with RASA and then will repeat the tests again. |
@anubhavpnp what kind of dataset is this? |
Bert is way way better than other models when i have tried it standalone. |
@akelad Its a dataset containing about 14500 sentences which are divided into 7 classes. i.e. 2.2 k sentences in each dataset of a class. I used the same dataset in both RASA and standalone google bert(according to the format of each) and then gave sample sentences to predict the classes. The formation of the sentence was very different then the training datasets. |
hi @winstarwang ..I have used your branch but I am getting below error when I try to train RASA nlu Below is the content of nlu_config.yml pipeline:
|
hi @winstarwang ..I notice that you have not handled offsets in the bert_tokenizer because of which the error is coming..Any idea of how to handle that? |
Thanks a lot @GaoQ1 ! ..I will try it |
Hi @GaoQ1 I have seen your implementation of an EmbeddingBERTClassifier. Am I able to use it with rasa version >= 1.0 ? What if I want to use a pretrained BERT model? Any help in which version is currently working would be appreciated since I am going to start some experiments into the direction of domain specific fine-tuning on a german BERT. Regards |
Hi @winstarwang ..Your repo was quite useful..Do you have any plans of modifying it so that it is compatible with rasa x ?Your code was working for me with old RASA versions. But not with rasax anymore.PLease do make the modification..That would be really great |
Hi @GaoQ1 ..Couple of questions:
|
Hi,
How do i get rid of these errors and exceptions? |
I have used this repo and it works fine |
I am so sorry, I didn't get back to you in time because of working on others.
|
I will try to merge the BERT codes to newest RASA version recently. |
@winstarwang I really liked your implementation and I implemented it. I also stumbled upon: https://github.com/JulianGerhard21/bert_spacy_rasa which simplifies a lot of the configurations you have to do. You should check it out and see if it's worth implementing your solution or the solution in bert_spacy_rasa. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
We added support for BERT and other known language models in our latest release 1.8.0. In order to use the pre-trained word embeddings from BERT, you need to include the following components in your pipeline:
You can read more about those components on our docs (https://rasa.com/docs/rasa/nlu/components/). |
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 23.0.3+incompatible to 23.0.4+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](moby/moby@v23.0.3...v23.0.4) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
I have tested Google's BERT as a text classifier, it performances very well in my company. So, I want to migrate BERT's power to RASA NLU. I'm workding on it recently, does anyone else interest?
The text was updated successfully, but these errors were encountered: