Machine learning based modeling of disordered elemental semiconductors: understanding the atomic structure of a-Si and a-C