One invalid extracted entity turns every entity in its chunk into Thing
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Inizia da src/selfgraph/extraction/extractor.py, in particolare da run() e dalla gestione di admit per entità in _assemble. Leggi il passaggio di estrazione e il flusso di convalida, quindi riproduci il problema con lo script fornito usando un’entità non valida. Il lavoro è completato quando le entità valide mantengono i tipi estratti, l’entità non valida viene eliminata con un avviso e la modalità schema rigorosa mantiene le entità e le relazioni ammissibili.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
insert.text with an LLM builds every EntityInput of the entities pass in one list comprehension. If one item fails validation (an empty or blank name or type, or an alias with a control, NUL, or surrogate character), the whole pass for that chunk becomes a single extraction_partial_failure warning. The relations pass then re-creates every name as the Thing fallback, so typed entities are stored under the wrong id.
With schema_mode="strict", the same chunk stores nothing: every thing:* entity and every relation on it is dropped as off-schema.
A later clean extraction of the same text writes person:ann next to the stray thing:ann.
Reproduce
On main (5a277c9), embedded Kuzu:
import asyncio, tempfile
from selfgraph import KuzuStore, SelfGraph
class LLM:
def __init__(self, **replies):
self.replies = replies
async def generate(self, *, system, user, output):
kind = next(iter(output.model_fields))
return {kind: self.replies.get(kind, [])}
llm = LLM(
entities=[
{"type": "Person", "name": "Ann"},
{"type": "Company", "name": "Acme"},
{"type": "Person", "name": ""},
],
relations=[{"from_name": "Ann", "type": "WORKS_AT", "to_name": "Acme"}],
)
async def main():
with tempfile.TemporaryDirectory() as tmp:
async with SelfGraph(store=KuzuStore(f"{tmp}/g.kuzu"), llm=llm) as g:
r = await g.insert.text("Ann works at Acme.")
print([e.id for e in r.entities])
print([w.message for w in r.warnings])
asyncio.run(main())
Prints ['thing:ann', 'thing:acme']. Expected person:ann and company:acme, with one warning for the dropped empty-name entity. Replacing the empty name with "aliases": ["Acme\u0007Inc"] on the Acme item, or "type": " " on a third item, gives the same result.
Cause
src/selfgraph/extraction/extractor.py, in run(): return [EntityInput(type=e.type, name=e.name, aliases=e.aliases or []) for e in items] sits inside the per-pass try, so one item's ValidationError is caught as a failure of the whole call. _assemble already drops invalid entities one at a time through admit, but never gets the list.
- Lingua principale
- TypeScript
- Stelle
- 173
- Fork
- 58
- Merge medio
- 6h
- PR unite (30g)
- 120
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hydra-db/selfgraph
-
approved-for-pr area: cli-mcp area: errors bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
hydra-db/selfgraph#401 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
approved-for-pr area: errors area: store bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
hydra-db/selfgraph#398 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
approved-for-pr area: errors area: write bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
hydra-db/selfgraph#392 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
approved-for-pr area: parity area: write bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
hydra-db/selfgraph#391 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di hydra-db/selfgraph
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
code-yeongyu/senpi#7139 ·
I maintainer di solito rispondono entro 1 giorno
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
lingdojo/kana-dojo#34395 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
bug status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
mastra-ai/mastra#31093 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:web p2 product:business triage:active type:bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 89/100
cuadrao-ai/argus#2328 ·
I maintainer di solito rispondono entro 1 giorno
-
bug frontend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
nikhilb2/simple_invoicing#907 ·