deeppavlov / DeepPavlov

An open source library for deep learning end-to-end dialog systems and chatbots.
https://deeppavlov.ai
Apache License 2.0
6.72k stars 1.15k forks source link

Question Answering Model for SQuAD - Use of specific huggingface BERT model #1171

Closed newuni closed 4 years ago

newuni commented 4 years ago

Could you provide a sample of config for Question Answering Model for SQuAD, like this https://github.com/deepmipt/DeepPavlov/blob/master/deeppavlov/configs/squad/squad_bert_multilingual_freezed_emb.json, but using a specific huggingface model like https://huggingface.co/mrm8488/distill-bert-base-spanish-wwm-cased-finetuned-spa-squad2-es?

Thanks in advance.

yurakuratov commented 4 years ago

Hi! To use models from HuggingFace in DeepPavlov BERT-SQuAD models you will have to convert them into TensorFlow format (with .ckpt files, bert_config.json and vocab.txt). HuggingFace has script to convert weights, but you will have to build bert_config.json and vocab.txt by yourself. After that, you can just update paths to converted model in configuration file.