Skip to content

refactor(core_text): split BenchDatasetEvaluatorQuestion.run and fix row indexing - #514

Merged
SunnyHaze merged 2 commits into
OpenDCAI:mainfrom
MBemera:refactor/bench-evaluator-run
Aug 12, 2026
Merged

refactor(core_text): split BenchDatasetEvaluatorQuestion.run and fix row indexing#514
SunnyHaze merged 2 commits into
OpenDCAI:mainfrom
MBemera:refactor/bench-evaluator-run

Conversation

@MBemera

@MBemera MBemera commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Builds on #513. run() held both evaluation modes inline at ~90 lines; this splits it into per-mode helpers.

That surfaced two real problems. Match mode indexed the answer Series by position, which is a label lookup on a pandas Series, so any frame with a non-default index (what an upstream filter produces) raised KeyError. And column validation ran after answer_match_result was already added, so a frame failing validation came back mutated. Both have new tests; the indexing one is parametrised over both modes on a frame indexed [3, 7].

Behaviour is otherwise unchanged. I exercised semantic, match and subquestion modes on gapped indices against the previous implementation. pytest test/ goes 75 to 78 passing, same 8 pre-existing failures.

Happy to adjust.

@SunnyHaze

Copy link
Copy Markdown
Collaborator

Thanks for your interest in DataFlow and for taking the time to contribute these fixes.

I noticed that this PR currently includes most of the commits from #513 in addition to the BenchDatasetEvaluatorQuestion refactor. To avoid reviewing and maintaining the same changes in two places, it would be better to keep this PR focused on the benchmark evaluator changes.

I’ll leave a separate comment on #513 regarding the shared runtime fixes.

MBemera and others added 2 commits August 12, 2026 21:23
…xing

run() carried both evaluation modes inline at ~90 lines. Splitting it
into per-mode helpers made two latent problems visible:

- Match mode indexed the answer Series by position. That is a label
  lookup on a pandas Series, so any frame with a non-default index --
  what an upstream filter produces -- raised KeyError. Now iterates
  dataframe.index.
- Column validation ran after 'answer_match_result' had already been
  added, so a frame failing validation came back mutated.

Also drops the unused numpy and json imports and the dead result_mask.
@SunnyHaze
SunnyHaze force-pushed the refactor/bench-evaluator-run branch from f0507ae to 28a8238 Compare August 12, 2026 13:37
@SunnyHaze

Copy link
Copy Markdown
Collaborator

Looks good to me. Thanks~

@SunnyHaze
SunnyHaze merged commit 5518733 into OpenDCAI:main Aug 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants