Get typed spans from the encoder
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
Línea de trabajo
Start with the encoder and detector implementations, the taxonomy head code, and the detector contract and custom taxonomy tests; the issue names no file paths, so locate these from the project structure. First read the detector contract and the existing typed golden fixtures, then trace how TransformerDetector handles taxonomy and usage. Done when typed EncoderDetector calls satisfy the acceptance criteria and the existing tests pass unchanged; the work is blocked by issue #148.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Parent
#126
Branch
Branch from stateless_core and open the pull request against it, not main. Close this ticket by hand once its pull request merges there: GitHub only closes issues automatically on merges into main.
What to build
An encoder detector that types its spans. The taxonomy typing head becomes a loaded object like the encoder: TaxonomyTyper takes an already loaded encoder and tokenizer, and from_pretrained is where its name becomes a model. With a typer, every span in a Detection carries category and subcategory, and the result's usage names the typer as well as the encoder, so a typed call is metered completely.
The old TransformerDetector(taxonomy_head=...) keeps working and keeps producing today's typed output.
Acceptance criteria
-
TaxonomyTyper(encoder, tokenizer, *, categories=None, subcategories=None, max_length=1024, model_id=None, model_version=None)takes loaded objects and downloads nothing;TaxonomyTyper.from_pretrained(model_id, *, device=None, categories=None, subcategories=None, model_version=None, **loader_kwargs)loads them and logsmodel_loaded. -
EncoderDetector.from_pretrained(..., taxonomy_head=<id or path>, include_taxonomy=...)builds the typer throughTaxonomyTyper.from_pretrained.include_taxonomyacceptsTrue, a list of category names, a flat{name: description}dict and the nested{"categories": ..., "subcategories": ...}dict, with the same meaning as today. - With a typer, every
DetectedSpanfromdetecthascategoryandsubcategory; without one both areNone. For aSourcesInputthe typer sees the sources joined by a newline, and for aPromptInputthe prompt, as today. -
adetecton a typedEncoderDetectorreturns a result equal todetect, with the same typed spans and the same twousageentries. -
usagehas two entries for an encoder with a typer: the encoder as before, and the typer with itsmodel_id,model_versionand the unitspans. When there are no spans the typer's entry reportsspansas 0. - A typer
from_pretrainedfor a local path takes the caller'smodel_version, and records the resolved commit otherwise. -
TransformerDetector(taxonomy_head=...)still types its spans, and the output equals the typed golden fixtures. - The detector contract suite passes for a typed
EncoderDetector. - The existing tests, including the custom taxonomy tests, pass unchanged.
- The changed code follows the Errors and logging section of
CONTRIBUTING.md, and no customer text is logged outsidelettucedetect.content.
Blocked by
#148
User stories covered
20, 40, 50
- Lenguaje dominante
- Python
- Estrellas
- 615
- Forks
- 60
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 10
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de KRLabsOrg/LettuceDetect
-
Stop-hook --min-confidence drops every --llm-model span (missing confidence treated as 0.0), reporting hallucinated answers as cleanPosiblemente ocupada @Clannad47 la tomó hace 19 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
KRLabsOrg/LettuceDetect#117 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
KRLabsOrg/LettuceDetect#108 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 Medio día Aptitud para principiantes 70/100
KRLabsOrg/LettuceDetect#104 ·
Los mantenedores suelen responder en 1 día
-
ready-for-agent
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
KRLabsOrg/LettuceDetect#181 ·
Los mantenedores suelen responder en 1 día
-
ready-for-agent
Dificultad 5/5 Más de una semana Aptitud para principiantes 22/100
KRLabsOrg/LettuceDetect#180 ·
Los mantenedores suelen responder en 1 día
Todos los issues de KRLabsOrg/LettuceDetect
Issues similares
-
Djangonauts
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
render-engine/render-engine-cli#71 ·
Los mantenedores suelen responder en 1 día
-
Installation guide's prerequisites leave out ca-certificates, which a no-recommends system needsAbiertobot-found documentation priority: P3
Dificultad 1/5 Menos de una hora Aptitud para principiantes 94/100
madenvel/KalinkaPlayer#544 ·
-
debt python-version
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microsoft/vscode-flake8#614 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días