utterworks / fast-bert

Super easy library for BERT based NLP models
Apache License 2.0
1.86k stars 341 forks source link

how to use pretrained bert model in fastbert? #141

Open adiv5 opened 4 years ago

adiv5 commented 4 years ago

I have pretrained bert model in pytorch with config and vocab file. I want to use it for multilabel classification task. My question is how to use it?

muzier commented 4 years ago

I have the same question... Thanks firstly for giving a method.

aaronbriel commented 4 years ago

Look at the predict_batch method.

yunju63 commented 4 years ago

There's a kind example in new-toxic-multilabel.ipynb

Here, you will have to change the model_name option to Bert. In addition, I changed several lines to adjust to my dataset and to print metrics on tensorboard.