Cohort selection for clinical trials using hierarchical neural network