3 ms·
There is a much more straightforward and principled way: the Metropolis algorithm (http://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm http://en.
by tudorachim 16y ago
There is a much more straightforward and principled way: the Metropolis algorithm (http://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm http://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_alg...). You are basically sampling from the distribution of n-gram likelihoods by following a markov chain. Here is a javascript implementation: http://www.andrew.cmu.edu/user/tachim/page.html http://www.andrew.cmu.edu/user/tachim/page.html
- abecedarius 16y agoSee also http://norvig.com/ngrams/ http://norvig.com/ngrams/ for Python. Random-restart hillclimbing instead of Metropolis.