MCPcopy Create free account
hub / github.com/google-research/language / main

Function main

language/table_text_eval/table_text_eval.py:450–474  ·  view source on GitHub ↗
(_)

Source from the content-addressed store, hash-verified

448
449
450def main(_):
451 reference_it = _text_reader(FLAGS.references, multiple=True)
452 generation_it = _text_reader(FLAGS.generations)
453 table_it = _table_reader(FLAGS.tables)
454
455 if FLAGS.entailment_fn == "cooccurrence":
456 assert FLAGS.cooccurrence_counts is not None
457 logging.info("Reading %s...", FLAGS.cooccurrence_counts)
458 with tf.gfile.Open(FLAGS.cooccurrence_counts) as f:
459 cooccur_counts = json.load(f)
460 entail_method = cooccur_probability_fn(cooccur_counts)
461 else:
462 entail_method = overlap_probability
463
464 precision, recall, f_score, all_f = parent(
465 generation_it,
466 reference_it,
467 table_it,
468 lambda_weight=FLAGS.lambda_weight,
469 smoothing=FLAGS.smoothing,
470 entailment_fn=entail_method)
471
472 logging.info("Evaluated %d examples.", len(all_f))
473 logging.info("Precision = %.4f Recall = %.4f F-score = %.4f",
474 precision, recall, f_score)
475
476if __name__ == "__main__":
477 flags.mark_flags_as_required(["references", "generations", "tables"])

Callers

nothing calls this directly

Calls 5

cooccur_probability_fnFunction · 0.85
_text_readerFunction · 0.70
_table_readerFunction · 0.70
parentFunction · 0.70
loadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…