question: public static Map < String , Integer > classNamesToMapping ( List < String > labels ) { Map < String , Integer > mapping = new HashMap < String , Integer > ( ) ; for ( int i = 0 ; i < labels . size ( ) ; i ++ ) { mapping . put ( labels . get ( i ) , i ) ; } return mapping ; }
target:  From a list of labels, creates a mapping from strings to indices.