October 2018
Intermediate to advanced
472 pages
10h 57m
English
Now that the model is ready, we can use it to make predictions. We will start by defining all of the parameters. While building inference, we need to provide some seed text, just like we did in the previous model. Along with that, we will also provide the path of the vocab file and the output file in which we will store the generated lyrics. We will also provide the length of the text that we need to generate:
import argparseimport codecsfrom modules.Model import *from modules.Preprocessing import *from collections import dequedef main(): parser = argparse.ArgumentParser() parser.add_argument('--model_name', type=str, required=True) parser.add_argument('--vocabulary_file', type=str, required=True) parser.add_argument('--output_file', ...Read now
Unlock full access