Does loss  function in the run_tf_ner.py takes logits or probabilities?
The model used for ner model is TFBertForTokenClassification in case of Tensorflow. According to documentation this model produces logits for every token. But the loss function that is used in `run_tf_ner.py` is `tf.losses.SparseCategoricalCrossentropy(reduction=tf.keras.losses.Reduction.NONE)` which has default argument `from_logits=False`. In this case the loss function expects probabilities but not the logits. So i would think that correct loss function should have additional argument `from_logits=True`. I'm building my own code using the `run_ner_tf.py` as an example, that is why i want to understand it. Am i missing something here? Because it looks like people can train the model and get some reasonable results...
I think you are right, I also find this bug, see [🐛Bugs in run_tf_ner.py](https://github.com/huggingface/transformers/issues/3389)<|||||>Hey @andrey999333! I answered to the question just here https://github.com/huggingface/transformers/issues/3389<|||||>Hey @jplu Thanks a lot, i have not noticed that line for some reason. I was wandering coz my code was working fine with the flag and yours without. Now the mystery is solved :)