Gravitational waves from the merger of two neutron stars cannot be easily distinguished from those produced by a comparable-mass mixed binary in which one of the companions is a black hole. Low-mass black holes are interesting because they could form in the aftermath of the coalescence of two neutron stars, from the collapse of massive stars, from matter overdensities in the primordial Universe, or as the outcome of the interaction between neutron stars and dark matter. Gravitational waves carry the imprint of the internal composition of neutron stars via the so-called tidal deformability parameter, which depends on the stellar equation of state and is equal to zero for black holes. We present a new data analysis strategy powered by Bayesian inference and machine learning to identify mixed binaries, hence low-mass black holes, using the distribution of the tidal deformability parameter inferred from gravitational-wave observations.