A Monte Carlo method for Bayesian dependency derivation