macanv / BERT-BiLSTM-CRF-NER

Tensorflow solution of NER task Using BiLSTM-CRF model with Google BERT Fine-tuning And private Server services
https://github.com/macanv/BERT-BiLSMT-CRF-NER
4.68k stars 1.25k forks source link

预测时,已经基于自己数据训练好了model_dir NER模型,为什么还需要原始的google bert_model_dir呢? #325

Open ghost opened 4 years ago

ghost commented 4 years ago

bert-base-serving-start \ -model_dir C:\workspace\python\BERT_Base\output\ner2 \ -bert_model_dir F:\chinese_L-12_H-768_A-12 -mode NER

如题,请问为什么需要bert_model_dir。在已经训练好model_dir 后,直接拿它预测不行么?

conquerSelf commented 4 years ago

我也有相同的问题,我猜是不是模型训练时对bert embedding部分参数进行了freezen没有训练,训练时模型参数也没有保存这一部分的参数,因此预测时还是需要bert embedding的参数。

YanRuYu123 commented 4 years ago

你是在win10系统运行吗?预训练的时候有没有遇到过打不开json文件的错误?

Heaven-zhw commented 4 years ago

同问

macanv commented 4 years ago

google bert dir 只是为了加载词表,没去加载Google的bert model

ghost commented 4 years ago

google bert dir 只是为了加载词表,没去加载Google的bert model

您的意思是bert_model_dir只是为了把文字变为embedding么~而没有加载model么

那model_dir不是也能把端到端的模型输出么~,输入时文字序列,输出是NER~~

ZeKunZhang1998 commented 3 years ago

bert-base-serving-start -model_dir C:\workspace\python\BERT_Base\output\ner2 -bert_model_dir F:\chinese_L-12_H-768_A-12 -mode NER

如题,请问为什么需要bert_model_dir。在已经训练好model_dir 后,直接拿它预测不行么?

请问怎么测试呀