public static void main(String[] args) {
        Evaluation eval = new Evaluation();

//        String candidateSum = "đội kiểmsoát thuộc cục hảiquan";
//        String referenceSum = "cục hảiquan đã pháthiện lôhàng được đóng trong container nữa";
//        int[] count_rouge = eval.rouge_1(candidateSum, referenceSum);
//        double count_match = count_rouge[0];
//        int count = count_rouge[1];
//
//        double recall = count_match / count;
//        double precision = count_match / (candidateSum.split("\\s+").length);
//        double F = (2 * recall * precision);
//        F = (F == 0) ? 0 : F / (recall + precision);
//        System.out.println(recall + "\t " + precision + "\t" + F);

//        int[] rouge_1 = eval.rouge(1"pulses may ease schizophrenic voices", 
//                "magnetic pulse series sent through brain may ease schizophrenic voices");
//        double[] rouge = eval.rouge(4, "corpus/AutoSummary/kinhte/KT01.txt", new String[]{"corpus/Summary/kinhte/KT01.txt"});
//        System.out.println("Recall = " + rouge[0] + "\tPrecision = " + rouge[1] + "\tF = " + rouge[2]);
//        double[] rouge = eval.rouge(1, "temp/1.txt", new String[]{"temp/2.txt"});
//        double[] rouge = eval.rouge(1, "corpus/AutoSummary/kinhte/KT01.txt", new String[]{"corpus/Summary/kinhte/KT01.txt"});
//        System.out.println("Recall = " + rouge[0] + "\tPrecision = " + rouge[1] + "\tF = " + rouge[2]);
//        double[][] rouge = eval.rouge("temp/2.txt", new String[]{"temp/1.txt"});
//        for (int i = 0; i < 4; i++) {
//            double[] r = rouge[i];
//            System.out.println("Recall = " + r[0] + "\tPrecision = " + r[1] + "\tF = " + r[2]);
//        }
        
        eval.createBaseLine();
        File dir = new File("corpus/BaselineSummary/");
        String[] directories = dir.list();
        int counter = 0;
        double[][] avg = new double[4][3];
        String output = "";
        for (String d : directories) {
            File directory = new File(dir.getPath() + "/" + d);
            if (directory.isFile()) {
                continue;
            }
            File[] files = directory.listFiles();    // Reading directory contents
            for (int k = 0; k < 2; k++) {
                try {
                    String name = files[k].getName();
                    double[][] rouge = eval.rouge(dir.getPath() + "/" + d + "/" + name,
                            new String[]{"corpus/Summary/" + d + "/" + name});
                    output += d + "/" + name + ":\n";
                    for (int i = 0; i < 4; i++) {
                        double[] r = rouge[i];
                        for (int j = 0; j < r.length; j++) {
                            avg[i][j] += r[j];
                        }
//                        System.out.print("corpus/AutoSummary/" + d + "/" + name + ":");
//                        System.out.println("Recall = " + r[0] + "\tPrecision = " + r[1] + "\tF = " + r[2]);
                        output += "Rouge-" + (i + 1) + ": \tRecall = " + r[0] + "\tPrecision = " + r[1] + "\tF = " + r[2] + "\n";
                    }
                    output += "\n";
                    counter++;
                } catch (Exception ex) {
                    System.out.println("Failure on file " + files[k].getPath() + "!\n\n");
                }
            }
        }
        System.out.println("\n" + counter + " văn bản đã được đánh giá");

        output += "Average:\n";
        for (int i = 0; i < 4; i++) {
            output += "Rouge-" + (i + 1) + ": \tRecall = " + avg[i][0] / counter + "\tPrecision = " + avg[i][1] / counter + "\tF = " + avg[i][2] / counter + "\n";
        }
        IOUtil.WriteToFile("temp/my_eval_baseline.txt", output);
        System.out.println(output);
    }