task B code now selects concept id based on frequency calculated from training data