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