Detection of overlapping communities in networks : a probabilistic approach