January 2019
Intermediate to advanced
342 pages
9h 17m
English
Putting it all together, the main function can be defined as having two flows: one for training and the other for inference. Even in the training function, we generate a few responses to the input tweet sequences to check how well we trained the model. The following code shows the main function for reference:
def main(self): if self.mode == 'train': X_train, X_test, y_train, y_test,test_sentences = self.data_creation() print(X_train.shape,y_train.shape,X_test.shape,y_test.shape) print('Data Creation completed') model = self.create_model() print("Model creation completed") model = self.train_model(model,X_train,X_test,y_train,y_test) test_responses = self.generate_response(model,test_sentences) print(test_sentences) ...Read now
Unlock full access