Text this: Integrating Bayesian network structure into normalizing flows and variational autoencoders