Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is the result of NDCG not stored in the eval_result.txt file? #5

Open
linh47 opened this issue Jan 29, 2020 · 0 comments
Open

Why is the result of NDCG not stored in the eval_result.txt file? #5

linh47 opened this issue Jan 29, 2020 · 0 comments

Comments

@linh47
Copy link

linh47 commented Jan 29, 2020

After running run_beauty.sh,I got eval_result.txt.
The eval_result.txt only included masked_lm_accuracy and masked_lm_loss.
I tried and found that NDCG and other evaluation metrics only outputed in the info log.
Could you please tell me how can I get these evaluation metrics results and store them in the result txt file?
I found the source codes as followed:
` #tf.logging.info('special eval ops:', special_eval_ops)
result = estimator.evaluate(
input_fn=eval_input_fn,
steps=None,
hooks=[EvalHooks()])

    output_eval_file = os.path.join(FLAGS.checkpointDir,
                                    "eval_results.txt")
    with tf.gfile.GFile(output_eval_file, "w") as writer:
        tf.logging.info("***** Eval results *****")
        tf.logging.info(bert_config.to_json_string())
        writer.write(bert_config.to_json_string()+'\n')
        for key in sorted(result.keys()):
            tf.logging.info("  %s = %s", key, str(result[key]))
            writer.write("%s = %s\n" % (key, str(result[key])))`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant