(input_file,out_file)
模型预测，加载按照F1保存的模型，9折交叉验证求平均
    :param input_file:
    :param out_file:
    :return:
模型预测，加载按照F1保存的模型，9折交叉验证求平均
    :param input_file:
    :param out_file:
    :return:
模型预测，加载按照F1保存的模型，9折交叉验证求平均 : param input_file : : param out_file : : return :
def predict(input_file,out_file):
    '''
    模型预测，加载按照F1保存的模型，9折交叉验证求平均
    :param input_file:
    :param out_file:
    :return:
    '''
    print('test predict')
    all_test=[]
    for i in range(9):
        # if not i==8:
        #     continue
        print(i)
        K.clear_session()
        model = link_model()
        filepath_loss = "model/ER_match_bert_f1.h5_" + str(i)
        test = get_input(input_file)
        model.load_weights(filepath_loss)
        y_pred_test = model.predict(test[:-1], batch_size=6, verbose=2)
        all_test.append(y_pred_test)

    all_test=np.mean(all_test,axis=0)
    np.save(out_file, all_test)
def predict ( input_file , out_file ) : print ( 'test predict' ) all_test = [ ] for i in range ( 9 ) : # if not i==8: #     continue print ( i ) K . clear_session ( ) model = link_model ( ) filepath_loss = "model/ER_match_bert_f1.h5_" + str ( i ) test = get_input ( input_file ) model . load_weights ( filepath_loss ) y_pred_test = model . predict ( test [ : - 1 ] , batch_size = 6 , verbose = 2 ) all_test . append ( y_pred_test ) all_test = np . mean ( all_test , axis = 0 ) np . save ( out_file , all_test )