Generating Text Using a Markov Model
The generate method takes in a conditional frequency distribution. Think – how many times did each word appear after'farm'? That is what a conditional frequency distribution outputs (for all words, not just'farm'). The rest of the generate function does is output text based on the distribution observed in the training data. I did this by making an array with each word that appeared after the current word.
Mar-24-2016, 09:35:18 GMT
- Technology: