Text this: Risk function and optimality of statistical procedures for identification of network structures