Detection of dynamic communities in temporal networks with sparse data