Deep Learning, Natural Language Process, Machine Learning, Markov Chains, Nlp Tutorial.
6. Generate text Finally, we’ll combine all the above functions to generate some text. def generateText(starting_sent,k=4,maxLen=1000): sentence = starting_sent ctx = starting_sent[-k:] for ix in range(maxLen): next_prediction = sample_next(ctx,model,k) sentence += next_prediction ctx =