Models: how to make predictions with run_classification.py

Created on 16 May 2020  路  4Comments  路  Source: tensorflow/models

Hi I'm new to tensorflow and neural networks. Trying to make predictions with BERT's run_classification.py(tf2.0). The readme.txt even shows how to "train_eval" but I want to see the prediction results for test.tsv. what should I do to predict?

support

All 4 comments

In https://github.com/tensorflow/models/blob/d93a1206faa5960348813f8f9237065845cf8c97/official/nlp/bert/run_classifier.py#L226, when you set FLAGS.use_keras_compile_fit, it will use keras to fit the model. You can model.predict() to do prediction.
This is an important function. We will add this ASAP.

@saberkun @chenGitHuber sorry to push you but, is there any progress?

@ekosis I am working on it. Sorry, I need to include some code clean up. Expect to get the commit in after the weekend.
In the meantime, the prediction method is inside the code.
Usage is shown in the colab: https://github.com/tensorflow/models/blob/master/official/colab/fine_tuning_bert.ipynb

@ekosis I updated the readme with https://github.com/tensorflow/models/commit/a2ed038546d8951b5cd39577a5d7899817ab4bf1
Please see if it works now.
Please also feel free to have a PR for new functionalities or documentation. Thank you!

Was this page helpful?
0 / 5 - 0 ratings