Darwin concludes his “On the Origin of Species” with the image of a “tangled bank” of species “dependent upon each other in so complex a manner.” This view of life as a complex network of interacting organisms has long permeated ecological thought. More recently, computational and mathematical tools have enabled the quantitative analysis of networks in many domains. In ecology, networks have been modeled in two primary ways: as collections of strongly connected modules or compartments; and as links emerging from biological traits, either from data or using an abstract “niche space” of feeding specialization. I will present work based on Bayesian probabilistic models that extend and combine these approaches. In a food web data set compiled from the Serengeti ecosystem of Tanzania, a model based on functional groups reveals a relationship between feeding guilds and habitat structure. Combining group structure with a two-dimensional model of niche space improves the statistical description substantially. Furthermore, by improving probabilistic models of network structure, we can better understand the robustness of food webs in response to extinctions.