Skip to content

An undeclared name does not become a node - #568

Merged
WaylandYang merged 2 commits into
devfrom
feat/undeclared-objects
Sep 9, 2026
Merged

An undeclared name does not become a node#568
WaylandYang merged 2 commits into
devfrom
feat/undeclared-objects

Conversation

@WaylandYang

@WaylandYang WaylandYang commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Closes #559.

What was wrong

Twenty percent of the AI-companies base was untyped entities, and 268 of those 296 had never been the subject of a fact. They were fact objects the extractor had not declared as entities: "lawsuit against OpenAI", "$5 billion", "March 2024", "machine learning models", "two executives in OpenAI". The relation-fact path created a node for any object (or subject) name it could not bind, type left empty, on the theory that the model had merely forgotten to declare it. Sometimes it had; mostly the name was a description or a value, and it became a node that find_entities then listed beside the real OpenAI.

Resolution was not the cause: the funnel ran and merged 123 entities in that base; these were never duplicates of anything.

What changed

A name that is neither declared in the extraction nor already known to the base does not become a node.

  • Known means an entity with that canonical name or alias, of any type, not merged away (resolution::existing_by_name, using the same recall keys as resolution: case-insensitive, generic suffixes stemmed). A forgotten declaration usually names something an earlier chunk or document declared, and that is found; a description is not.
  • An unknown subject drops the fact with the existing subject_not_declared signal.
  • An unknown object keeps the fact and stores the name as a literal object_value, with the matched predicate when the ontology has one (a passive form that would need the object as subject gets no predicate; the word stays on the evidence), and a new drop signal object_undeclared so the rate can be read per base. The fact is still visible on the subject, still cited, still counted; it just does not mint an entity.
  • Declared entities are untouched, typed or not; the is_entity_name guard and the clause labels are untouched.

Measured

The eight AI-companies documents, extracted twice on 2026-09-09 with the schema.org pack and DeepSeek-V3: once on dev (baseline), once on this branch merged with #569 (after). Both runs completed with the base-level jobs (type resolution, adjudication, bootstrap) settled; both lost a few chunks to rate limiting and were requeued to completion (baseline 228 of 229 chunks, after 229 of 229).

baseline after
entities 1,243 987
untyped 218 (18%) 16 (2%)
untyped that were never a subject 190 2
facts 2,340 2,404
facts with a literal object 522 814
facts with a predicate 827 863
entities matching "OpenAI" 41, of which 13 untyped 21, of which 1 untyped
object_undeclared signals n/a 15
subject_not_declared signals 0 9

What the new signal caught, in full: persona, temporary injunction, civil investigative demand, the web for up-to-date information, recent events, marketers, several institutions, published news stories, SSI funding round, research team to investigate AI ethics, designed around human oversight, responding to prompts including descriptors of people, solutions in C, C++, Python, and MATLAB, 517 questions about software engineering or computer programming, coding. The dropped subjects: educators (×4), users, students, investors, eleven employees, training data, study. Nothing in either list reads as a forgotten entity.

The sixteen untyped entities that remain are declared ones whose proposed type the ontology lacks (investigation ×3, contract, settlement, Constitutional AI, Sequoia Capital, …); those are the type-adoption loop's to pick up, not this change's.

The literal-object count rises by more than the fifteen signals because the model's output differs between runs (it declared fewer entities the second time); the signal counts the cases this rule decided. The two runs are one sample each; the untyped share and the never-a-subject count are the numbers the issue asked for and they moved by an order of magnitude.

Tests

  • an_undeclared_name_is_looked_up (store, database): found by canonical name, by case, by alias, by generic-suffix stem; not found when merged away; a description is not found.
  • Extraction's existing tests unchanged.

🤖 Generated with Claude Code

@WaylandYang
WaylandYang marked this pull request as ready for review September 9, 2026 17:50
@WaylandYang
WaylandYang force-pushed the feat/undeclared-objects branch from 6753c13 to 17ee4af Compare September 9, 2026 17:52
WaylandYang and others added 2 commits September 10, 2026 06:37
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A descriptive phrase becomes an entity

1 participant