This talk is about the problem of recovering block structures in graphical models from observed labellings. Such problems arise, e.g., in the general paradigm of "community detection", where one knows that a system consists of components that can be divided into two different "communities", but needs to find which community each component is in by looking at some observed behaviour of the individual components. We will look at a recent approach inspired from statistical mechanics that is based on a variant of the mean field Ising model and see how the phase transitions in this model relate to the statistical problem of recovering block structures. Based on joint work with Quentin Berthet and Philippe Rigollet. Reference: "Exact Recovery in the Ising blockmodel." Q. Berthet, P. Rigollet and P. Srivastava. To appear in Ann. Stat. arXiv:1612.03880.