exact_match: ignore_punctuation only removes ASCII punctuation
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- machine-learning
Research direction
Start with the exact_match metric implementation and its tests, locating where ignore_punctuation uses string.punctuation. Check how punctuation is removed and add coverage for the Arabic comma and guillemets alongside the ASCII example in the issue. Done when Unicode punctuation is stripped and the examples score as expected.
Written by the indexing model from the issue text.
Description
ignore_punctuation=True is documented as removing all punctuation, but it uses string.punctuation, so non-ASCII punctuation like the Arabic comma ، or «» is kept and correct answers score 0. Stripping Unicode punctuation (categories P*) would fix it.
import evaluate
em = evaluate.load("exact_match")
em.compute(predictions=["Cairo,"], references=["Cairo"], ignore_punctuation=True) # 1.0
em.compute(predictions=["القاهرة،"], references=["القاهرة"], ignore_punctuation=True) # 0.0
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 380
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from huggingface/evaluate
-
radar_plot fails on pandas 3 (data.loc with 1-tuple key)Possibly taken @davrens101 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
huggingface/evaluate#854 ·
-
EvaluationSuite.run fails with default args_for_task and mutates supplied kwargsPossibly taken @ktz03 claimed this 32 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
huggingface/evaluate#825 ·
-
exact_match scores two different answers as a perfect match when normalization erases both to the same residuePossibly taken @MahendraMula claimed this 49 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
huggingface/evaluate#822 ·
-
Perplexity metric fails with GPT-2 tokenizerPossibly taken @zanvari claimed this 147 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
huggingface/evaluate#766 · 1 comment ·
-
False/misleading instruction to use different checkpoints of BLEURTMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 62/100
huggingface/evaluate#679 · 1 reaction ·
All issues in huggingface/evaluate
Similar issues
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gke-labs/kube-agents#5671 ·
Maintainers usually reply within 1 day
-
docs(auth): Method B step 4 should tell users to tick "Use this client for an AI-powered agent"Opendocumentation next-release v0.9.6
Difficulty 1/5 Under an hour Newbie friendliness 88/100
khuisman/mcp-gee-sweet#1446 ·
Maintainers usually reply within 1 day
-
model:sonnet runtime:claude security size:S
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
FootprintAI/Containarium#3671 ·
Maintainers usually reply within 1 day
-
HolidayBase: reassigning `language` does not re-initialize translations or re-populate holidaysPossibly taken @shikhabhadoria claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vacanza/holidays#4116 · 1 comment ·
Maintainers usually reply within 1 day
-
bug CLI exec
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day