liuwei1206 / LEBERT

Code for the ACL2021 paper "Lexicon Enhanced Chinese Sequence Labelling Using BERT Adapter"
338 stars 60 forks source link

For LEBERT NER tasks, how to set the "model_type" parameter? #5

Closed rachel2011 closed 3 years ago

rachel2011 commented 3 years ago

I'm planning to do Chinese NER with the LeBert model. From my understanding I have to set model_type = "LEBertCRF_Token" to train LEBERT model, but I got an error like this "UnboundLocalError: local variable 'model' referenced before assignment". Is there anything else I have to change? Any example or lead would be really helpful.

yinazhu commented 3 years ago

SET model_type="WCBertCRF_Token" OR model_type="BertWordLSTMCRF_Token" ~~~嘻嘻

liuwei1206 commented 3 years ago

Hi,

I appreciate @yinazhu 's reply and it is right. The model_type should be set to "WCBertCRF_Token" and "BertWordLSTMCRF_Token", and they correspond to "LEBERT" and "BERT+Word".

I would like to suggest you take a look at the source code first before you use it.

Wei