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

Before Change


        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: 4

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: soft-matter/trackpy
Commit Name: acb7ee5791213f2c0b948f7b87d810f436ceb860
Time: 2012-12-06
Author: daniel.b.allan@gmail.com
File Name: mr/wire_models.py
Class Name: Model
Method Name: fit


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