Machine learning high multiplicity matrix elements for electron-positron and hadron-hadron colliders