-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add JGLUE tasks #469
base: main
Are you sure you want to change the base?
Conversation
def correlation_metric(golds: list[int], predictions: list[str], **kwargs): | ||
def convert_to_float(score): | ||
try: | ||
return float(score) | ||
except ValueError: | ||
return None | ||
|
||
predicted_score = convert_to_float(predictions[0]) | ||
gold_score = convert_to_float(golds[0]) | ||
|
||
return { | ||
"predicted_score": predicted_score, | ||
"gold_score": gold_score, | ||
} | ||
|
||
|
||
def spearman_corpus_metric(items): | ||
predicted_scores, gold_scores = zip( | ||
*[ | ||
(item["predicted_score"], item["gold_score"]) | ||
for item in items | ||
if (item["gold_score"] is not None and item["predicted_score"] is not None) | ||
] | ||
) | ||
r, _ = spearmanr(predicted_scores, gold_scores) | ||
if np.isnan(r): | ||
return 0.0 | ||
frac = len(predicted_scores) / len(items) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NathanHB I believe we could add these 2 to core metrics, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definitely !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! This looks good to me from a glance, thanks for the very detailed work!
Did you try to reproduce with this implementation the results obtained with llm-jp-eval, to make sure it is correct?
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
JGLUE is a widely used test set in the Japanese LLM research community, consisting of five sub-tests (with MARC-ja removed due to a request from Amazon):
JSTS
JNLI
JSQuAD
JCommonsenseQA
Finished Issue #455