Machine-learning prediction of exciton binding energies in two-dimensional materials for photonics application