Delegate the LLMDetector judge path to LLMJudgeDetector

Aperta
#161 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
ai, backend

Direzione di ricerca

Start with lettucedetect/detectors/llm.py and the LLMJudgeDetector constructor and LLMJudgeConfig mapping; first run the listed pytest command after blocker #160 is resolved. Check tests/test_llm_detector_pytest.py and tests/test_custom_taxonomy_pytest.py for expected behavior. Done means the judge prediction methods delegate to LLMJudgeDetector, preserve the specified dict outputs and min_confidence mapping, and the acceptance tests pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

ready-for-agent

Parent: #156 · Epic: #126 · Blocked by: #160
Branch from stateless_core; open the PR against it.

Problem

Until the judge path of LLMDetector runs through LLMJudgeDetector, there are two implementations that can drift apart.

Current behavior

  • lettucedetect/detectors/llm.py:395 _predict, :297 _to_spans, :487 _verify and :533-625 predict* hold the judge logic directly on LLMDetector.
  • Existing tests patch private methods on it.

Steps

  1. Inside LLMDetector, for the judge case, build a LLMJudgeDetector from the constructor arguments (map keywords to LLMJudgeConfig) and make predict, predict_prompt and predict_prompt_batch convert its Detection into today's dicts (confidence from score).
  2. Keep the private method names that existing tests call as thin wrappers where needed. Keep min_confidence mapping to min_score.
  3. Argument handling, deprecation warnings and the native path stay as they are (#167, #165).

Acceptance criteria

  • predict* output equals the #129 judge fixtures except spans that had no confidence now carry 1.0 (intended change).
  • tests/test_llm_detector_pytest.py and tests/test_custom_taxonomy_pytest.py pass unchanged.
  • No duplicate judge logic remains on LLMDetector.

Start here

uv run --extra dev pytest tests/test_llm_detector_pytest.py tests/test_golden_llm_pytest.py -q
Lingua principale
Python
Stelle
615
Fork
60
Merge medio
1g 8h
PR unite (30g)
10

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di KRLabsOrg/LettuceDetect

Tutte le issue di KRLabsOrg/LettuceDetect

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.