train_eval_steps/extract_answers.py
def extract_strings(json_file_in, guess_file_out):
    """Extracts the answer string from the file."""
    result_lines = []
    with tf.gfile.Open(json_file_in, "r") as reader:
        input_data = json.load(reader, object_pairs_hook=collections.OrderedDict)
        for eid, predictions in input_data.iteritems():
            print(eid)
    result_lines.append(predictions)
    with tf.gfile.Open(guess_file_out, mode="w") as fout:
        for l in result_lines:
            fout.write(l.encode("utf-8")+"\n")
Extracts the answer string from the file.
Extracts the answer string from the file.
Extracts the answer string from the file .
def extract_strings(json_file_in, guess_file_out):
    result_lines = []
    with tf.gfile.Open(json_file_in, "r") as reader:
        input_data = json.load(reader, object_pairs_hook=collections.OrderedDict)
        for eid, predictions in input_data.iteritems():
            print(eid)
    result_lines.append(predictions)
    with tf.gfile.Open(guess_file_out, mode="w") as fout:
        for l in result_lines:
            fout.write(l.encode("utf-8")+"\n")
def extract_strings ( json_file_in , guess_file_out ) : result_lines = [ ] with tf . gfile . Open ( json_file_in , "r" ) as reader : input_data = json . load ( reader , object_pairs_hook = collections . OrderedDict ) for eid , predictions in input_data . iteritems ( ) : print ( eid ) result_lines . append ( predictions ) with tf . gfile . Open ( guess_file_out , mode = "w" ) as fout : for l in result_lines : fout . write ( l . encode ( "utf-8" ) + "\n" )
Extracts the answer string from the file.
Extracts the answer string from the file .
"""Extracts the answer string from the file."""
json_file_in
guess_file_out