-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
where is the math? #140
Comments
Thanks for the kind words, @randomgambit! I'm not a trained mathematician, so I am not the most authoritative person to answer this, but I believe that this chapter of Grinstead and Snell provides a helpful overview: https://www.dartmouth.edu/~chance/teaching_aids/books_articles/probability_book/Chapter11.pdf Does that answer your question? |
thank you! yes i know how markov chains work but I am not sure how do you implement them in the package. what is the transition matrix, how many states, etc. Can you please share more details? thanks! |
Hi @randomgambit. The state size defaults to 2 but is configurable. The transition matrix is calculated in markovify.chain.Chain. |
got it, but it is a bit hard to understand what is going on by just looking at the code. I think it would immensely help if you could write a small example of how the algo works (by using, say, a corpus of just two simple sentences). |
Would something like this satisfy your curiosity?:
{
('___BEGIN__', '___BEGIN__'): {'After': 1, 'Janice': 1},
('___BEGIN__', 'After'): {'that,': 1},
('___BEGIN__', 'Janice'): {'walked': 1},
('After', 'that,'): {'Janice': 1},
('Janice', 'walked'): {'to': 2},
('that,', 'Janice'): {'walked': 1},
('the', 'park.'): {'___END__': 1},
('the', 'zoo.'): {'___END__': 1},
('to', 'the'): {'park.': 1, 'zoo.': 1},
('walked', 'to'): {'the': 2}}
}
|
super interesting!!! thanks! I really think you should include this example on the main page. I am just trying to figure out the exact size of the transition matrix in the example above... can we write it down or there are too many rows/columns? Thanks! |
Hi there and thanks for this beautiful package!! i was curious to understand more the inner workings of the package. Is there a pdf that explains how you use Markov chains exactly to create a model (with some equations)?
thanks!
The text was updated successfully, but these errors were encountered: