    public static void printLabelings(Classifier classifier, File vectorfile, String outputFilename) throws IOException {
        CsvIterator reader =
            new CsvIterator(new FileReader(vectorfile),
                            "(.+)\\t(.+)\\t(.*)",
                            3, 2, 1);
        Iterator<Instance> instances =
            classifier.getInstancePipe().newIteratorFrom(reader);
        CsvIterator reader2 = 
            new CsvIterator(new FileReader(vectorfile),
                            "(.+)\\t(.+)\\t(.*)",
                            3, 2, 1);
        PrintStream output = new PrintStream(new FileOutputStream(outputFilename));
        while (instances.hasNext()) {
        	Instance reader2Instance = reader2.next();
        	Instance instance = (Instance) instances.next();
            Labeling labeling = classifier.classify(instance).getLabeling();
            output.print(instance.getName() + "\t");
            Object trueLabel = reader2Instance.getTarget();
            if(trueLabel!=null)
            	output.print(trueLabel.toString() + "\t");
            for (int rank = 0; rank < labeling.numLocations(); rank++){
                output.print(labeling.getLabelAtRank(rank) + ":" +
                                 labeling.getValueAtRank(rank) + " ");
            }
            output.println();
        }
    }

    public static void printLabelings(Classifier classifier, File vectorfile, String outputFilename) throws IOException {
        CsvIterator reader =
            new CsvIterator(new FileReader(vectorfile),
                            "(.+)\\t(.*)\\t(.*)",
                            3, 2, 1);
        Iterator<Instance> instances =
            classifier.getInstancePipe().newIteratorFrom(reader);
        CsvIterator reader2 = 
            new CsvIterator(new FileReader(vectorfile),
                            "(.+)\\t(.*)\\t(.*)",
                            3, 2, 1);
        PrintStream output = new PrintStream(new FileOutputStream(outputFilename));
        while (instances.hasNext()) {
        	Instance reader2Instance = reader2.next();
        	Instance instance = (Instance) instances.next();
            Labeling labeling = classifier.classify(instance).getLabeling();
            output.print(instance.getName() + "\t");
            Object trueLabel = reader2Instance.getTarget();
            if(trueLabel!=null)
            	output.print(trueLabel.toString() + "\t");
            for (int rank = 0; rank < labeling.numLocations(); rank++){
                output.print(labeling.getLabelAtRank(rank) + ":" +
                                 labeling.getValueAtRank(rank) + " ");
            }
            output.println();
        }
    }
