def main(_): tf_logging.info("Train albert") config = JsonConfig.from_json_file(FLAGS.model_config_file) train_config = TrainConfigEx.from_flags(FLAGS) input_fn = input_fn_from_flags(input_fn_builder_classification, FLAGS) model_fn = model_fn_classification(config, train_config, Albert.factory) return run_estimator(model_fn, input_fn)
def main(_): tf_logging.info("Run generative predictor") config = JsonConfig.from_json_file(FLAGS.model_config_file) train_config = TrainConfigEx.from_flags(FLAGS) input_fn = input_fn_from_flags(input_fn_builder_classification, FLAGS) model_fn = model_fn_generative_predictor(config, train_config) return run_estimator(model_fn, input_fn)
def main(_): tf_logging.info("Train horizon classification") config = JsonConfig.from_json_file(FLAGS.model_config_file) train_config = TrainConfigEx.from_flags(FLAGS) input_fn = input_fn_from_flags(input_fn_builder_classification, FLAGS) model_fn = model_fn_classification(config, train_config, BertologyFactory(HorizontalAlpha)) return run_estimator(model_fn, input_fn)
def main_inner(): train_config = TrainConfigEx.from_flags(FLAGS) model_fn = model_fn_classification( train_config=train_config, ) input_fn = input_fn_from_flags(input_fn_builder, FLAGS) r = run_estimator(model_fn, input_fn) return r
def main(_): config = JsonConfig.from_json_file(FLAGS.bert_config_file) sero_config = JsonConfig.from_json_file(FLAGS.model_config_file) train_config = TrainConfigEx.from_flags(FLAGS) input_fn = input_fn_from_flags(input_fn_builder_classification, FLAGS) model_fn = model_fn_classification(config, train_config, partial(DualSeroBertModel, sero_config), FLAGS.special_flags.split(",")) return run_estimator(model_fn, input_fn)
def main(_): config = JsonConfig.from_json_file(FLAGS.model_config_file) train_config = TrainConfigEx.from_flags(FLAGS) input_fn = input_fn_from_flags(input_fn_builder_classification, FLAGS) model_fn = model_fn_classification(config, train_config, BertModel) r = run_estimator(model_fn, input_fn) return r
def main(_): tf_logging.info("Classification with alt loss") config = JsonConfig.from_json_file(FLAGS.model_config_file) train_config = TrainConfigEx.from_flags(FLAGS) input_fn = input_fn_from_flags(input_fn_builder_classification, FLAGS) model_fn = model_fn_classification_with_alt_loss(config, train_config, BertModel) if FLAGS.do_predict: tf_logging.addFilter(MuteEnqueueFilter()) return run_estimator(model_fn, input_fn)
def main(_): bert_config = modeling.BertConfig.from_json_file(FLAGS.bert_config_file) input_files = flags_wrapper.get_input_files() train_config = TrainConfigEx.from_flags(FLAGS) show_input_files(input_files) model_fn = model_fn_explain( bert_config=bert_config, train_config=train_config, logging=tf_logging, ) input_fn = input_fn_from_flags(input_fn_builder_classification, FLAGS) r = run_estimator(model_fn, input_fn) return r
def run_w_data_id(): input_files = get_input_files_from_flags(FLAGS) bert_config = BertConfig.from_json_file(FLAGS.bert_config_file) train_config = TrainConfigEx.from_flags(FLAGS) show_input_files(input_files) model_fn = model_fn_classification_for_lr_debug( bert_config, train_config, ) if FLAGS.do_predict: tf_logging.addFilter(CounterFilter()) input_fn = input_fn_from_flags(input_fn_builder_classification, FLAGS) result = run_estimator(model_fn, input_fn) return result
def main(_): bert_config = modeling.BertConfig.from_json_file(FLAGS.bert_config_file) train_config = TrainConfigEx.from_flags(FLAGS) model_class = BertModel special_flags = FLAGS.special_flags.split(",") model_fn = model_fn_ranking_ndcg( bert_config=bert_config, train_config=train_config, model_class=model_class, special_flags=special_flags, ) input_fn = input_fn_from_flags(input_fn_builder, FLAGS) r = run_estimator(model_fn, input_fn) return r
def main_inner(model_class=None): bert_config = modeling.BertConfig.from_json_file(FLAGS.bert_config_file) train_config = TrainConfigEx.from_flags(FLAGS) if model_class is None: model_class = BertModel special_flags = FLAGS.special_flags.split(",") model_fn = model_fn_classification( bert_config=bert_config, train_config=train_config, model_class=model_class, special_flags=special_flags, ) input_fn = input_fn_from_flags(input_fn_builder, FLAGS) r = run_estimator(model_fn, input_fn) return r
def run_classification_task(model_class): config = JsonConfig.from_json_file(FLAGS.model_config_file) train_config = TrainConfigEx.from_flags(FLAGS) input_fn = input_fn_from_flags(input_fn_builder_classification, FLAGS) model_fn = model_fn_classification(config, train_config, model_class, FLAGS.special_flags.split(",")) return run_estimator(model_fn, input_fn)