Keras metric callback (#14867)
Keras metric callback (#14867)

* Working on splitting out labels

* First working version

* Fixed concatenation of outputs and labels

* val_dataset -> eval_dataset

* Only pass input arrays in tokenizer.model_input_names

* Only pass input arrays in tokenizer.model_input_names

* Only remove unexpected keys when predict_with_generate is True

* Adding proper docstring

* Adding example to docstring

* Add a proper ROUGE metric example

* Add a proper ROUGE metric example

* Add version checking

* Update src/transformers/keras_callbacks.py

Co-authored-by: Sylvain Gugger <222c4d44cc8ec39802c192ed0aa3f97cdb77ff4e@users.noreply.github.com>

* Update src/transformers/keras_callbacks.py

Co-authored-by: Sylvain Gugger <222c4d44cc8ec39802c192ed0aa3f97cdb77ff4e@users.noreply.github.com>

* Update src/transformers/keras_callbacks.py

Co-authored-by: Sylvain Gugger <222c4d44cc8ec39802c192ed0aa3f97cdb77ff4e@users.noreply.github.com>

* Update src/transformers/keras_callbacks.py

Co-authored-by: Sylvain Gugger <222c4d44cc8ec39802c192ed0aa3f97cdb77ff4e@users.noreply.github.com>

* Remove requirement for tokenizer with predict_with_generate

Co-authored-by: Sylvain Gugger <222c4d44cc8ec39802c192ed0aa3f97cdb77ff4e@users.noreply.github.com>
huggingface/transformers,huggingface/transformers,huggingface/transformers,huggingface/transformers