response_match_score fails correct Thai, Lao, Khmer and Myanmar answers with digits or Latin words
Maintainer antworten meist innerhalb von 3 Tagen
@sanketpatil06 arbeitet bereits daran.
Seit 23.11.2026.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python
- Bereich
- internationalization, testing
Rechercherichtung
The bug is in the non-spaced-script branch of _UnicodeAwareTokenizer.tokenize in src/google/adk/evaluation/final_response_match_v1.py. Compare it with the digit and punctuation handling in src/google/adk/memory/_sqlite_memory_service.py. Done means the Minimal Reproduction Code prints 1.00 PASSED on every line. A pull request (#8300) is already open against this issue, so check it before starting.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
🔴 Required Information
Describe the Bug:
response_match_score (ROUGE-1, default pass mark 0.8) fails correct answers in Thai, Lao, Khmer and Myanmar script in two cases. Both are in the non-spaced-script branch of _UnicodeAwareTokenizer.tokenize (src/google/adk/evaluation/final_response_match_v1.py).
- A digit or Latin word written right after the script's letters is glued to the last letter cluster. The branch puts a space before each cluster but none after it.
ราคา100is tokenized as['ร', 'า', 'ค', 'า100']andราคา 100as['ร', 'า', 'ค', 'า', '100'], so the same answer scores 0.67. The other order (100บาท) and Chinese (价格100) are already split. - Punctuation and symbols in these scripts' Unicode blocks are kept as words (Khmer
។, Myanmar။, Thai฿), while punctuation in every other script is dropped.ទេ។againstទេscores 0.67;No.againstNoscores 1.0.
An agent's answer and the expected answer can easily differ in just this spacing or a final full stop.
Steps to Reproduce:
pip install "google-adk[eval]"- Save the script under "Minimal Reproduction Code" as
adk_scores.py. - Run
python adk_scores.py.
Expected Behavior:
1.00 PASSED on every line. Each pair is the same answer, written with and without a space, a full stop or a currency sign.
Observed Behavior:
0.67 FAILED Thai + digits: ราคา100 | ราคา 100
0.40 FAILED Thai + Latin word: ซื้อiPhone | ซื้อ iPhone
0.67 FAILED Lao + digits: ລາຄາ100 | ລາຄາ 100
0.57 FAILED Khmer + digits: តម្លៃ100 | តម្លៃ 100
0.57 FAILED Myanmar + digits: ဈေးနှုန်း100 | ဈေးနှုန်း 100
0.67 FAILED Khmer full stop: ទេ។ | ទេ
0.86 PASSED Myanmar full stop: ဟုတ်ကဲ့။ | ဟုတ်ကဲ့
0.00 FAILED Thai baht sign: ฿100 | 100
1.00 PASSED Chinese + digits: 价格100 | 价格 100
1.00 PASSED ASCII sign and full stop: $100. | 100
Environment Details:
- ADK Library Version (pip show google-adk): 2.15.0 (the tokenizer is the same on
mainat 2b90353) - Desktop OS: Linux (Ubuntu 25.10)
- Python Version (python -V): 3.11.17
Model Information:
- Are you using LiteLLM: No
- Which model is being used: N/A, the metric runs without a model
🟡 Optional Information
Regression:
No. It has been this way since the Unicode-aware tokenizer was added in 2.6.0 (#6292).
Logs:
N/A. The output is under "Observed Behavior".
Screenshots / Video:
N/A
Additional Context:
- ADK's memory search already handles both cases:
_split_script_runssplits Latin letters and digits from other scripts, and_is_token_chardrops punctuation (src/google/adk/memory/_sqlite_memory_service.py). - Zero-width joiners inside a word are a separate question (#8181) and are not part of this report.
- I have a fix with tests ready and am opening the pull request now.
Minimal Reproduction Code:
from google.adk.evaluation.eval_case import Invocation
from google.adk.evaluation.eval_metrics import BaseCriterion
from google.adk.evaluation.eval_metrics import EvalMetric
from google.adk.evaluation.final_response_match_v1 import RougeEvaluator
from google.genai import types
CASES = [
# A digit or Latin word written right after the script's letters.
("Thai + digits", "ราคา100", "ราคา 100"),
("Thai + Latin word", "ซื้อiPhone", "ซื้อ iPhone"),
("Lao + digits", "ລາຄາ100", "ລາຄາ 100"),
("Khmer + digits", "តម្លៃ100", "តម្លៃ 100"),
("Myanmar + digits", "ဈေးနှုန်း100", "ဈေးနှုန်း 100"),
# The script's own punctuation or currency sign.
("Khmer full stop", "ទេ។", "ទេ"),
("Myanmar full stop", "ဟုတ်ကဲ့။", "ဟုတ်ကဲ့"),
("Thai baht sign", "฿100", "100"),
# Controls: the same patterns in Chinese and in ASCII.
("Chinese + digits", "价格100", "价格 100"),
("ASCII sign and full stop", "$100.", "100"),
]
def invocation(text: str) -> Invocation:
return Invocation(
user_content=types.Content(parts=[types.Part(text="question")]),
final_response=types.Content(parts=[types.Part(text=text)]),
)
evaluator = RougeEvaluator(
EvalMetric(
metric_name="response_match_score",
criterion=BaseCriterion(threshold=0.8),
)
)
for label, answer, reference in CASES:
result = evaluator.evaluate_invocations(
[invocation(answer)], [invocation(reference)]
)
status = result.overall_eval_status.name
print(f"{result.overall_score:.2f} {status:<6} {label}: {answer} | {reference}")
How often has this issue occurred?:
- Always (100%)
- Vorherrschende Sprache
- Python
- Sterne
- 22.3k
- Forks
- 4.4k
- Ø Merge
- 1 T. 2 Std.
- Gemergte PRs (30 T.)
- 6
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus google/adk-python
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
google/adk-python#8360 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
google/adk-python#8359 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Can pin to litellm version be changed?Evtl. vergeben @llalitkumarrr hat das vor 10 Tagen übernommen. Offenmodels
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 65/100
google/adk-python#8129 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 3 Tagen
-
OpenAPI tools ignore operation- and path-level server overridesEvtl. vergeben @sanketpatil06 hat das vor 14 Tagen übernommen. Offentools
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
google/adk-python#8064 · 4 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Two docstrings in openapi_tool document parameters the signatures do not acceptEvtl. vergeben @surajksharma07 hat das vor 17 Tagen übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
google/adk-python#8024 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 3 Tagen
Alle Issues in google/adk-python
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
vllm-project/vllm#70030 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
TigreGotico/tugaphone#408 ·
Maintainer antworten meist innerhalb von 1 Tag
-
needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
gke-labs/kube-agents#7308 ·
Maintainer antworten meist innerhalb von 1 Tag
-
t: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 3 Tagen
-
chore
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
lugassawan/swe-workbench#841 ·