Enhance percentage handling to accept raw numbers without % symbol
まだ誰も着手していません。
評価
調査の方向性
まず、LatexExtractionConfig と ExprExtractionConfig を使って parse と verify のエントリポイントを追跡し、issue の例を動作の基準として使用します。パーセンテージの処理を更新し、"$28\%$" と "28" が同等として比較されるようにしつつ、"percent" や "percentage" のような単語形式は維持してから、3つすべての例についてカバレッジを追加するか実行します。
索引モデルが issue の本文から書いたものです。
説明
Description:
Currently, the verification system correctly handles:
"$28\%$" vs "28 percent" → True (word forms work)
"$28\%$" vs "28" → False (strict % symbol required)
We should modify the behavior so that:
"$28\%$" vs "28" → True (treat raw numbers as percentages)
While maintaining existing support for word forms ("percent", "percentage", etc.)
Example Code:
from math_verify import parse, verify, LatexExtractionConfig, ExprExtractionConfig
# https://huggingface.co/datasets/t-tech/T-math
def accuracy_reward(latex1: str, latex2: str, strict: bool = True) -> bool:
"""
Compare two LaTeX expressions for semantic equivalence, normalizing both before comparison.
Args:
latex1 (str): First LaTeX expression.
latex2 (str): Second LaTeX expression.
strict (bool): Whether to enforce strict variable matching (default: True).
Returns:
bool: True if the expressions are semantically equivalent, False otherwise.
"""
# Ensure both inputs are treated as LaTeX
def ensure_latex(s):
s = s.strip()
if not (s.startswith("$") and s.endswith("$")):
return f"${s}$"
return s
extraction_configs = [LatexExtractionConfig(), ExprExtractionConfig()]
parsed1 = parse(ensure_latex(latex1), extraction_configs)
parsed2 = parse(ensure_latex(latex2), extraction_configs)
return verify(parsed1, parsed2, strict=strict)
accuracy_reward("$28\\%$", "28 percentage")
accuracy_reward("$28\\%$", "28")
- 主要言語
- Python
- スター
- 1.2k
- フォーク
- 65
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
huggingface/Math-Verify のほかの issue
-
verify() raises ValueError comparing chained relations of different length対応中かも @chetana1410 が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
huggingface/Math-Verify#93 ·
-
A period inside the math delimiters (`$\frac{1}{3}.$`) makes correct answers fail and can make wrong ones pass対応中かも @MohammadHijjawi97 が 25 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
huggingface/Math-Verify#85 ·
-
evaluate_model_outputs.py: rows whose gold cannot be extracted are dropped from the accuracy denominator, so the printed accuracy disagrees with the is_correct column the script writes対応中かも @shaurya416 が 30 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
huggingface/Math-Verify#83 ·
-
verify() rejects a not-equal written in the other order対応中かも @chetana1410 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
huggingface/Math-Verify#100 ·
-
verify() rejects an absolute-value inequality that is the same interval対応中かも @chetana1410 が 2 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
huggingface/Math-Verify#98 ·
huggingface/Math-Verify の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
nansencenter/geodataset#39 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
awslabs/visual-asset-management-system#804 ·
メンテナーはふだん 1 日以内に返信
-
follow-up
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
link-rot
難易度 1/5 1時間未満 初心者へのやさしさ 67/100