Fitting community models to large sparse networks