AssistantBench: scoring a dict answer crashes on "{}" and on lists that mix dicts with other values

オープン
#418 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@damienen がすでに取り組んでいます。

2026年11月2日 から。

  • #419 @damienen による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
numpy, python
領域
ai

調査の方向性

The scorer lives in browsergym/assistantbench/src/browsergym/assistantbench/evaluation/evaluator.py, with the crashing paths in question_scorer, calc_recall and evaluate_dicts. Run the repro script from the issue against a checkout to see the three failing inputs. Pull request #419 is already open against this issue, so review it before starting. Done means all three answers return a score in [0, 1] without raising.

索引モデルが issue の本文から書いたものです。

説明

question_scorer in the AssistantBench evaluator raises instead of returning a score when the gold answer is a dict and the prediction is {}, or a list whose first element is a dict but later elements are not. A model can emit either as its final answer, so validation of those tasks crashes.

Two causes:

  • calc_recall averages an empty list for {}, which gives NaN, and the alignment step then raises ValueError.
  • evaluate_dicts only checks that pred[0] is a dict, then calls .get on every element.

Repro

Needs numpy==2.1.3 scipy==1.14.1. Set SRC to a checkout of the repo.

import os, sys, types, importlib
src = os.environ.get("SRC", "src")
base = os.path.join(src, "browsergym/assistantbench/src/browsergym/assistantbench")
pkg = types.ModuleType("ab"); pkg.__path__ = [base]; sys.modules["ab"] = pkg
ev = importlib.import_module("ab.evaluation.evaluator")
gold = '{"sender": "USPS", "price (usd)": "41.75"}'
cases = ['{"sender": "USPS", "price (usd)": "41.75"}', '{}',
         '[{"sender": "USPS", "price (usd)": "41.75"}, "maybe FedEx"]']
for p in cases:
    try:
        print("OK", p, "->", ev.question_scorer(p, gold))
    except Exception as e:
        print("CRASH", p, "->", type(e).__name__, e)

Expected: a score in [0, 1] for all three answers.

Actual:

OK {"sender": "USPS", "price (usd)": "41.75"} -> (np.float64(1.0), 1.0)
CRASH {} -> ValueError matrix contains invalid numeric entries
CRASH [{"sender": "USPS", "price (usd)": "41.75"}, "maybe FedEx"] -> AttributeError 'str' object has no attribute 'get'

Seen at 0a785fbed075 and still present on main at 27a90ce81509. I have a small fix ready and can open a PR.

主要言語
Python
スター
1.4k
フォーク
202
平均マージ
6日 15時間
マージ済み PR(30日)
3

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ServiceNow/BrowserGym のほかの issue

ServiceNow/BrowserGym の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。