HXX97 / EDGQA

Codes for "EDG-based Question Decomposition for Complex Question Answering over Knowledge Bases"
GNU General Public License v3.0
12 stars 5 forks source link

Confusion about function toString and toQALDString in CumulativeIRMetrics.java #5

Closed scarlettllc closed 3 years ago

scarlettllc commented 3 years ago

I feel confused about the correspondence between macro F1 and getMicroF1() in both function toString and toQALDString in file CumulativeIRMetrics.java. Maybe there is a small mistake? public String toString() { return "sample: " + numSample + ", P: " + decimalFormat.format(getPrecision()) + ", R: " + decimalFormat.format(getRecall()) + ", macro F1: " + decimalFormat.format(getMicroF1()) + ", macro F1*: " + decimalFormat.format(getMacroF1()); } public String toQALDString() { return "sample: " + numSample + ", P: " + decimalFormat.format(getPrecision()) + ", R: " + decimalFormat.format(getRecall()) + ", macro F1: " + decimalFormat.format(getMicroF1()) + ", QALD macro F1: " + decimalFormat.format(getMacroF1()); } }

yhshu commented 3 years ago

Problem fixed.


    public double getAverageF1() {
        if (numSample == 0)
            return 0.0;
        return cumulativeMicroF1 / numSample;
    }

    public double getMacroF1() {
        if (getPrecision() + getRecall() == 0.0)
            return 0.0;
        return 2.0 * (getPrecision() * getRecall()) / (getPrecision() + getRecall());
    }

    public String toString() {
        return "sample: " + numSample + ", P: " + decimalFormat.format(getPrecision()) + ", R: " + decimalFormat.format(getRecall()) + ", macro F1: " + decimalFormat.format(getMacroF1());
    }

    public String toQALDString() {
        return "sample: " + numSample + ", P: " + decimalFormat.format(getPrecision()) + ", R: " + decimalFormat.format(getRecall()) + ", average F1: " + decimalFormat.format(getAverageF1()) + ", QALD macro F1: " + decimalFormat.format(getMacroF1());
    }
}

More information are detailed in the QALD paper.