import markovify # Get raw text as string. with open("input.txt") as f: text = f.read() # Build the model. text_model = markovify.Text(text) print("Five Random texts: \n#################################################\n\n") # Print five randomly-generated sentences for i in range(7): print(text_model.make_sentence()+"\n\n") print("three randomly-generated sentences of no more than 140 characters: \n#################################################\n\n") # Print three randomly-generated sentences of no more than 140 characters for i in range(3): print(text_model.make_short_sentence(140)+"\n\n")