def train(): X, Y = self.loader.load_data(self.trainFileNames, max_len=Meta.max_string_len) model = NN.train(X, Y) model.save('../Model/model') self.log('结束训练') setState('ready')
import Core.NN as NN from Utils.Preprocessor import Preprocessor import Utils.Meta as Meta if __name__ == '__main__': p = Preprocessor() X, Y = p.load_data( ['../DataSet/BarackObama.csv', '../DataSet/DonaldTrumpTweets'], Meta.max_string_len) model = NN.train(X, Y) model.save('../Model/model')
import Core.NN as NN from Utils.Preprocessor import Preprocessor import Utils.Meta as Meta if __name__ == '__main__': p = Preprocessor() X, Y = p.load_data([ '../DataSet/BarackObama.csv', '../DataSet/DonaldTrumpTweets' ], Meta.max_string_len) model = NN.train(X, Y) model.save('../Model/model')