Constructing Hierarchical Bayesian Networks With Pooling