2999e509688a82f8be65600727a5922b5739822b,conceptnet5/vectors/evaluation/wordsim.py,,compute_semeval_score,#Any#Any#,309

Before Change


        low_harmonic_mean = float("NaN")
        high_harmonic_mean = float("NaN")
    else:
        acc_harmonic_mean = hmean([spearman_score["acc"], pearson_score["acc"]])
        low_harmonic_mean = hmean([spearman_score["low"], pearson_score["low"]])
        high_harmonic_mean = hmean([spearman_score["high"], pearson_score["high"]])

    return pd.Series(
        [acc_harmonic_mean, low_harmonic_mean, high_harmonic_mean],
        index=["acc", "low", "high"]
    )


def evaluate_semeval_monolingual(vectors, lang):
    

After Change


    measure was 0 or negative. Otherwise, take a harmonic mean of a Pearson correlation coefficient
    and a Spearman correlation coefficient.
    
    intervals = ["acc", "low", "high"]
    scores = []
    for interval in intervals:
        if any(np.isnan(x) for x in [spearman_score[interval], pearson_score[interval]]):
            scores.append(float("NaN"))
        elif any(x <= 0 for x in [spearman_score[interval], pearson_score[interval]]):
            scores.append(0)
        else:
            scores.append(hmean([spearman_score[interval], pearson_score[interval]]))

    return pd.Series(
        scores,
        index=intervals
    )


def evaluate_semeval_monolingual(vectors, lang):
    
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: commonsense/conceptnet5
Commit Name: 2999e509688a82f8be65600727a5922b5739822b
Time: 2017-03-08
Author: joanna.teresa.duda@gmail.com
File Name: conceptnet5/vectors/evaluation/wordsim.py
Class Name:
Method Name: compute_semeval_score


Project Name: cesium-ml/cesium
Commit Name: 2ab1119596b420cc696a783271d617562ccf7e28
Time: 2017-03-29
Author: brettnaul@gmail.com
File Name: cesium/featurize.py
Class Name:
Method Name: featurize_single_ts


Project Name: etal/cnvkit
Commit Name: d5fe1575d0b6e620e767d666e13a00cd5078dcb0
Time: 2018-07-02
Author: etalevich@dnanexus.com
File Name: skgenome/intersect.py
Class Name:
Method Name: into_ranges