Tips for Tensorflow 2.0 NER task by using fit method.
# ❓ Questions & Help

<!-- The GitHub issue tracker is primarly intended for bugs, feature requests,
     new models and benchmarks, and migration questions. For all other questions,
     we direct you to the Hugging Face forum: https://discuss.huggingface.co/ .
     You can also try Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. In this case, make sure to tag your
     question with the right deep learning framework as well as the
     huggingface-transformers tag: 
     https://stackoverflow.com/questions/tagged/huggingface-transformers 
     -->

## Details
<!-- Description of your issue -->

Any tips for implementing TF2 NER (TF Token Classifier) by using model.fit method?

An official example does not use model.fit for NER task.

Any links or tips will be appreciated.


<!-- You should first ask your question on the forum or SO, and only if
     you didn't get an answer ask it here on GitHub. -->
**A link to original question on the forum/Stack Overflow**:
@aiscientist 
Why would you need to use `model.fit()` method? I think it is a more low level way to train your model. There's an easy way to train HuggingFace models with `TFTrainer`. All you need to do, is to initialize pretrained config, tokenizer and model, create your own Dataset class for NER data, and just pass it to the trainer. It will do all the rest.<|||||>> @aiscientist
> Why would you need to use `model.fit()` method? I think it is a more low level way to train your model. There's an easy way to train HuggingFace models with `TFTrainer`. All you need to do, is to initialize pretrained config, tokenizer and model, create your own Dataset class for NER data, and just pass it to the trainer. It will do all the rest.

Yes, I need to finish this job using model.fit() following from the TensorFlow guideline (Like Keras Style), but for NER task it's kinda hard to manage loss because of model.fit().  Using Pytorch is easier but, I need to use model.fit for this task because of several reasons. I just want to know that it is possible to use TF Token Classifier on model.fit(). If not, I need to discuss with my co-workers and find another way to do it.<|||||>This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
