I made a small Markov Chain joke generator during my coffee break sometime last week. This is in continuation to the last post, where we did a similar thing. I did this specifically to see how well it could be extended in a language which I have typically not used before for ML/NLP. Let me run you guys through it. First of all, the Markhov Chains need a bunch of data to tell it how exactly you want your sentences constructed. str_arr=[sentence1, sentence2,...] Next, we create a dictionary of all trigrams present across the sentences. To do this, we use all bigrams as keys, and the succeeding word as the corresponding values. The key-value pairs thus form a trigram. As an example, consider the sentence : “The man had a dog.” The dictionary for this sentence will have : [ {[The, man] : [had]}, {[man, had] : [a]}, {[had, a] : [dog]} ] Next up, using the dictionary that we just made to create sentences. Here we provide the first two words, and let the function work
Shall i call this......the wanderings of a calm mind?