如何将Bert本地化为Bert_module_hub

时间:2020-09-25 03:03:33

标签: python-3.x neural-network nlp bert-language-model

我只想将我的本地Bert 转到此处:

bert_module = hub.Module( BERT_MODEL_HUB , trainingable = True)

如何添加我的本地bert? 我有Tensorflow == 1.15和python == 3.7

def create_model(is_predicting, input_ids, input_mask, segment_ids, labels,
                 num_labels):
  
  bert_module = hub.Module(
      BERT_MODEL_HUB,
      trainable=True)
  bert_inputs = dict(
      input_ids=input_ids,
      input_mask=input_mask,
      segment_ids=segment_ids)
  bert_outputs = bert_module(
      inputs=bert_inputs,
      signature="tokens",
      as_dict=True)

0 个答案:

没有答案