The statistical model for community detection is a promising research area in network analysis.Most existing statistical models of community detection are designed for networks with a known type of community structure,but in many practical situations,the types of community structures are unknown.To cope with unknown community structures,diverse types should be considered in one model.We propose a model that incorporates the latent interaction pattern,which is regarded as the basis of constructions of diverse community structures by us.The interaction pattern can parameterize various types of community structures in one model.A collapsed Gibbs sampling inference is proposed to estimate the community assignments and other hyper-parameters.With the Pitman-Yor process as a prior,our model can automatically detect the numbers and sizes of communities without a known type of community structure beforehand.Via Bayesian inference,our model can detect some hidden interaction patterns that offer extra information for network analysis.Experiments on networks with diverse community structures demonstrate that our model outperforms four state-of-the-art models.