public static List<String> extractOutcomeLabelsFromPredictions(File predictionsFile,BidiMap labelsToIntegersMapping) throws IOException {
  List<String> result=new ArrayList<>();
  for (  String line : FileUtils.readLines(predictionsFile)) {
    Integer intLabel=Integer.valueOf(line);
    String outcomeLabel=(String)labelsToIntegersMapping.getKey(intLabel);
    result.add(outcomeLabel);
  }
  return result;
}

public static List < String > extractOutcomeLabelsFromPredictions ( File predictionsFile , BidiMap labelsToIntegersMapping ) throws IOException { List < String > result = new ArrayList < > ( ) ; for ( String line : FileUtils . readLines ( predictionsFile ) ) { Integer intLabel = Integer . valueOf ( line ) ; String outcomeLabel = ( String ) labelsToIntegersMapping . getKey ( intLabel ) ; result . add ( outcomeLabel ) ; } return result ; }
reads the prediction file ( each line is a integer ) and converts them into original outcome labels using the mapping provided by the bi - directional map
