check_currentmetric() inverts accuracy/f1: exact-match generations score 0.0, all-wrong/empty generations score 1.0
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- testing-qa
Direzione di ricerca
Inizia da check_currentmetric() in codefuseEval/execution.py:680-683 e confronta la logica identica a livello di byte in codefuseEval_202503/execution.py:681-684. Esamina metrics/accuracy/accuracy.py, metrics/f1/f1.py e metrics/accuracy/README.md, quindi verifica che le corrispondenze esatte ricevano il punteggio corretto per entrambe le metriche pubbliche e aggiungi una copertura di regressione per la polarità.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
codefuseEval/execution.py:680-683 (byte-identical duplicate at codefuseEval_202503/execution.py:681-684):
if metric == "accuracy" or metric == "f1":
predictions = [0 if prediction == reference else 1 for prediction, reference in
zip(predictions, references)]
references = [1] * len(references)
...
result = metric_module.compute(predictions=predictions, references=references, **kwargs)
When prediction == reference (the generation is correct), this assigns 0; when they differ, it assigns 1. references is then set to all-1s, and the arrays are handed to metrics/accuracy/accuracy.py's Accuracy._compute:
def _compute(self, predictions, references, normalize=True, sample_weight=None):
return {"accuracy": float(accuracy_score(references, predictions, normalize=normalize, sample_weight=sample_weight))}
sklearn.accuracy_score counts the fraction where predictions[i] == references[i] == 1, i.e. the fraction of mismatches. This is the exact inverse of the contract documented in metrics/accuracy/README.md ("Accuracy is the proportion of correct predictions among the total number of cases processed"). f1 shares the identical transform and inverts the same way.
What happens (reproduced on the real module)
check_currentmetric() in codefuseEval/execution.py:680-683 (byte-identical at codefuseEval_202503/execution.py:681-684, both confirmed against the repo's current HEAD 09a4f2af) inverts the accuracy/f1 polarity: on a match it assigns predictions=0 and sets all references=1, then hands these to the vendored HuggingFace evaluate Accuracy/F1 classes (metrics/accuracy/accuracy.py, metrics/f1/f1.py, unmodified), whose sklearn.accuracy_score/f1_score then measure the mismatch rate rather than the match rate — independently reproduced against real sklearn: a 10/10-correct model scores accuracy=0.0/f1=0.0, a 0/10 or all-empty-output model scores accuracy=1.0, exactly contradicting metrics/accuracy/README.md's documented contract. Both accuracy and f1 are public, unguarded CLI-selectable metrics (METRIC_SUPPORT in evaluation.py) with no caller-side correction, no pinning test, and no existing issue/PR — any invocation with --metric accuracy or --metric f1 (e.g. against the registered spider_test/text2sql dataset, whose post-processor only extracts SQL text and performs no scoring of its own) hits this. The one-line polarity flip suggested in the report (swap which branch maps to 0 vs 1) is the correct fix, matching the already-correct polarity convention used a few lines away in the pass@k path (evaluation.py:477-479).
Happy to open the PR.
- Lingua principale
- Python
- Stelle
- 111
- Fork
- 19
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di codefuse-ai/codefuse-evaluation
-
Any related paper?Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 15/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
是不是可以增加基于api的测试Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
codefuse-ai/codefuse-evaluation#8 · 1 commento ·
Tutte le issue di codefuse-ai/codefuse-evaluation
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistenciesForse già presa @github-actions l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
admission-deferred priority: medium status: ready work-class: scoped
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
melodic-software/claude-code-plugins#10887 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
backend bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
PoCInnovation/Distribox#255 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google/langextract#598 ·
I maintainer di solito rispondono entro 1 giorno