Markov Chain Text Generation

This program generates text in the style of either Shakespeare or Donald Trump. It was built with corpora of text documents (Shakespeare's plays and Trump's speeches). The documents were processed a bit to create uniformity, then were tokenized and split into bigrams and trigrams. These n-grams were used to create conditional frequency distributions of consecutive word occurrences. For example, the word "dog" might have a 50% chance of being followed by "food", 25% chance of "park", 10% of "barking", and so forth. With these probabilities, and given a seed phrase, we can generate passages of text that possess a similar style to the original authors, although with an obvious and amusing loss of semantic content.

Shakespeare
Trump
Loading...
Generate

Back