Skip to content

fix(matching): do not read the article "a" as option A - #1811

Merged
ssiq merged 2 commits into
open-compass:mainfrom
mengchen-atx:cursor/fix-verbose-answer-article-a-9d09
Nov 5, 2026
Merged

ssiq merged 2 commits into
open-compass:mainfrom
mengchen-atx:cursor/fix-verbose-answer-article-a-9d09

Conversation

@mengchen-atx

Copy link
Copy Markdown
Contributor

Fixes #1810.

Follow-up to #1740 and #1751.

#1751 added a word boundary to _VERBOSE_ANSWER_RE, so The answer is cat. is no longer read as C. The pattern is still case-insensitive, though, and the article a is its own word. \b does not reject it, so The answer is a horse. is still parsed as option A. Once can_infer_option returns a letter, can_infer_text and the judge fallback never run. A correct answer written as option text is scored as A, and a non-answer such as The answer is a dog. is scored as a pick of A.

The change keeps the lowercase labels the current tests rely on (Answer is **d**., the answer is a., answer is **a**, and The answer is A because ...). It only skips a lowercase a when another word follows, which is the English article. The answer is a horse. then falls through to text matching and comes back as C; The answer is a dog. stays unresolved.

Requiring an uppercase label, as #1740 suggested, does fix the article, but it breaks 24 existing subtests (for example Answer is **d**.).

tests/test_matching_option_boundaries.py covers the four cases from the issue. On current main they fail because can_infer_option returns A. After this change the file passes: 6 tests, including those four and the previous boundary cases.

python3 -m unittest tests/test_matching_option_boundaries.py

The verbose-answer pattern stayed case-insensitive after open-compass#1751, so a
standalone lowercase "a" still matched option A. Skip that article when
a word follows it and let the option text fall through to can_infer_text.

Co-authored-by: Meng Chen <[email protected]>
@mengchen-atx

Copy link
Copy Markdown
Contributor Author

Hi @ssiq, friendly ping on this small follow-up to #1751 (fixes #1810): it stops answers like The answer is a horse. from being scored as option A. Since this is my first PR here, the CI workflows need a maintainer's approval to run. Could you approve them and take a look when you have time? Thanks!

@ssiq
ssiq added this pull request to the merge queue Nov 5, 2026
Merged via the queue into open-compass:main with commit 98a0181 Nov 5, 2026
3 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.

can_infer_option still reads the article "a" as option A after #1751 ("The answer is a horse." → A)

2 participants