A Probabilistic Generative Model of Free Categories