Type spans in EncoderDetector.detect and meter the typer
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 54/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
Start with EncoderDetector._detect, EncoderDetector.adetect, EncoderDetector.from_pretrained, and TransformerDetector; the issue also points to taxonomy_head.py:96 and transformer.py:383. Run the listed pytest command first, then trace how spans and usage are built and inspect the typed golden fixtures from #128. Done when typed and untyped outputs, both usage entries, and the stated test suites match the acceptance criteria.
索引モデルが issue の本文から書いたものです。
説明
Parent: #153 · Epic: #126 · Blocked by: #154, #150
Branch from stateless_core; open the PR against it.
Problem
A typed call is not metered completely and typed spans don't exist in Detection: the typer's work is invisible in usage, and category/subcategory appear only in the old dicts.
Current behavior
- Typing happens in the old
predictpath viaTaxonomyTyper.type_spans(taxonomy_head.py:96) after_build_spans_from_tokens(transformer.py:383); context is the sources joined by newline (or the prompt). Detectionhas no typer usage entry.
Steps
- In
EncoderDetector._detect, when a typer is set, call it for the spans and fillDetectedSpan.categoryandsubcategory; without a typer both areNone. Context: sources joined by"\n"forSourcesInput, the prompt forPromptInput. - Add a second
Usagefor the typer: itsmodel_id,model_version, unitspans(0 when there are no spans). adetecton a typedEncoderDetectorneeds no override: it runsdetect, including the typer call, in one worker thread, so the typed result is the same as the sync one.EncoderDetector.from_pretrained(taxonomy_head=..., include_taxonomy=...)builds the typer throughTaxonomyTyper.from_pretrained, all fourinclude_taxonomyforms.TransformerDetector(taxonomy_head=...)still types spans; output equals the typed golden fixtures from #128.
Acceptance criteria
- With a stub typer every span has
categoryandsubcategory; without one bothNone. -
await adetect(...)on a typedEncoderDetectorequalsdetect: samecategory/subcategoryon every span and the same twousageentries; the loop stays free while it waits. - Two
usageentries with a typer, one without; typer entry reportsspans= 0 when there are none. - Typed golden fixtures and
tests/test_custom_taxonomy_pytest.pypass unchanged. - Contract suite passes for a typed
EncoderDetector; follows CONTRIBUTING "Errors and logging".
Start here
uv run --extra dev pytest tests/test_custom_taxonomy_pytest.py tests/test_golden_transformer_pytest.py -q
- 主要言語
- Python
- スター
- 615
- フォーク
- 60
- 平均マージ
- 2日 18時間
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
KRLabsOrg/LettuceDetect のほかの issue
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
KRLabsOrg/LettuceDetect#108 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 半日 初心者へのやさしさ 70/100
KRLabsOrg/LettuceDetect#104 ·
メンテナーはふだん 1 日以内に返信
-
Bugs: One typed detect interface for the detectors package対応中かも @hslev が 1 日前に担当しました。 オープン
KRLabsOrg/LettuceDetect#192 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
ready-for-agent
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
KRLabsOrg/LettuceDetect#181 ·
メンテナーはふだん 1 日以内に返信
-
ready-for-agent
難易度 5/5 1週間以上 初心者へのやさしさ 22/100
KRLabsOrg/LettuceDetect#180 ·
メンテナーはふだん 1 日以内に返信
KRLabsOrg/LettuceDetect の issue をすべて見る
似ている issue
-
question
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
vllm-project/vime#524 ·
メンテナーはふだん 7 日以内に返信
-
WOPI editor page is scrollable by a few pixels, which breaks scrolling in the document (Firefox)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
suitenumerique/drive#969 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
theupdateframework/python-tuf#3044 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
FAIRmat-NFDI/pynxtools#861 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
NVIDIA/nsight-python#88 ·
メンテナーはふだん 1 日以内に返信