3D extinction mapping using hierarchical Bayesian models