import tensorflow as tf


        predict_drop_remainder = True if FLAGS.use_tpu else False
        predict_input_fn = file_based_input_fn_builder(
            input_file=predict_file,
            seq_length=FLAGS.max_seq_length,
            is_training=False,
            drop_remainder=predict_drop_remainder)

        result = estimator.predict(input_fn=predict_input_fn)

        output_predict_file = os.path.join(FLAGS.output_dir, "test_results.tsv")

        with tf.gfile.GFile(output_predict_file, "w") as writer:
            num_written_lines = 0
            tf.logging.info("***** Predict results *****")
            for (i, prediction) in enumerate(result):
                if i >= num_actual_predict_examples:
                    break
                probabilities = prediction["probabilities"]
                texta=predict_examples[i].text_a
                texta=tokenizer.tokenize(texta)
                phrase=[texta[j] if probabilities[j]>=0.5 else ' ' for j in range(min(len(texta),128))]
                phrase=''.join(phrase).strip()
                # output_line = "\t".join(
                #     str(class_probability)
                #     for class_probability in probabilities) + "\n"
                writer.write(phrase+'\n')
                num_written_lines += 1
