Skip to content

fix: support non-English languages in response_match_score eval metric - #6494

Closed
guptaishaan wants to merge 1 commit into
google:mainfrom
guptaishaan:fix/issue-3111-3018
Closed

fix: support non-English languages in response_match_score eval metric#6494
guptaishaan wants to merge 1 commit into
google:mainfrom
guptaishaan:fix/issue-3111-3018

Conversation

@guptaishaan

Copy link
Copy Markdown

The response_match_score metric uses the rouge_score library to compute
ROUGE-1 F1 between the actual and expected responses. The library's default
tokenizer strips every character that is not [a-z0-9], which discards all
non-ASCII text (Thai, Chinese, Japanese, Arabic, etc.) and produces an empty
token list. As a result, even perfectly-matching non-English strings receive a
score of 0.0.

The fix introduces a _UnicodeTokenizer that preserves ASCII words as-is and
falls back to character-level tokenization for tokens containing non-ASCII
characters. This ensures that identical non-English strings are scored 1.0
while the existing scoring behaviour for English text is unchanged (validated
by the existing unit tests). A new regression test covering identical Thai
text is also added.

Fixes #3111.

The `response_match_score` metric uses the `rouge_score` library to compute

Signed-off-by: Ishaan <ishaangupta0408@gmail.com>
@adk-bot adk-bot added the eval [Component] This issue is related to evaluation label Jul 27, 2026
@i-yliu i-yliu assigned i-yliu and unassigned ankursharmas Jul 27, 2026
@i-yliu

i-yliu commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Closing this PR and consolidating review and follow ups in #6292

@i-yliu i-yliu closed this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eval [Component] This issue is related to evaluation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eval fails for non-English languages

4 participants