ebanalyse / NERDA

Framework for fine-tuning pretrained transformers for Named-Entity Recognition (NER) tasks
MIT License
153 stars 35 forks source link

feature request for saving models #2

Closed kawsarnoor closed 3 years ago

kawsarnoor commented 3 years ago

hi, firstly thanks for putting this together. It has saved me a lot of time for some small development projects. I understand that saving and loading models can be done using the standard torch libraries but was wondering if you saw it useful to have a save function somewhere on the main nerda model class. Thanks

smaakage85 commented 3 years ago

hi @kawsarnoor

Thank you for giving NERDA a spin :) And I am so happy to hear, that it has saved you some time on your project.

Yeah, the network itself can be saved using torch.save().

If you want to save a NERDA model configuration, I suggest you create a NERDA.precooked model, e.g.

https://github.com/ebanalyse/NERDA/blob/main/src/NERDA/precooked.py

=>

class EN_BERT_ML(Precooked).

But besides from that, I think, you are right! We need a NERDA save method :) I will implement it in the next version.

Thank you for the feedback.

Best, Lars