Repository navigation
fix(entities): give names their real types instead of Term - #395
Merged
Merged
Conversation
The default rules extractor typed a capitalised name as a person only after a title, an organisation only before Inc/Corp-like words and a product only with a digit, so people, places and most organisations came out as Term. name_types.py types each name from the name and the words around it: titles and roles, given names, verbs of saying, the words a name starts or ends with, "a company called X", built-in lists of places, well-known organisations and products, holidays and dates, and the namespace's named speakers. A name gets one type per recording, "and" no longer joins two names, and a role before a name is not part of it. Upgrade step entity-types types the Terms analysis made on existing installs, keeping types people or agents set; it is recorded in the graph history as entity.typed so it can be rolled back. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MeaEgM8m7rTjbkKVQVsrT
…-qfebqj # Conflicts: # CHANGELOG.md
The graph shows Raspberry Pi only once both imports are analysed (one recording's mentions are below graph.min_edge_weight). Converting the uploaded file took 42-46 s on some runners, so graph-merge opened the graph before the second import was done and timed out. It now waits, uncounted, until the top bar's activity says nothing is running or queued. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MeaEgM8m7rTjbkKVQVsrT
…-qfebqj # Conflicts: # CHANGELOG.md # DEVLOG.md # ci/clicks/journeys.mjs # docs/processing.md # fastapi_backend/app/domain/migrations.py # fastapi_backend/tests/domain/test_migrations.py
…-qfebqj Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MeaEgM8m7rTjbkKVQVsrT
…-qfebqj Main's entity_finder (spaCy fetched when picked) now also takes the namespace's named speakers for the rules, in analysis and in the workflows' rules node. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MeaEgM8m7rTjbkKVQVsrT
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MeaEgM8m7rTjbkKVQVsrT
adeelahmad
pushed a commit
that referenced
this pull request
Oct 17, 2026
Since #395 the entity-types upgrade step types Terms such as Monday as Dates, which the entities list leaves out unless asked for, so the check read them as gone. It now lists the quiet types too: an entity may change type in an upgrade, but none may go. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013sC1p4dJXjteytbxDXnk5g
This was referenced Oct 17, 2026
adeelahmad
pushed a commit
that referenced
this pull request
Oct 17, 2026
Since #395 the entity-types upgrade step types Terms such as Monday as Dates, which the entities list leaves out unless asked for, so the check read them as gone. It now lists the quiet types too: an entity may change type in an upgrade, but none may go. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013sC1p4dJXjteytbxDXnk5g
adeelahmad
added a commit
that referenced
this pull request
Oct 17, 2026
Since #395 the entity-types upgrade step types Terms such as Monday as Dates, which the entities list leaves out unless asked for, so the check read them as gone. It now lists the quiet types too: an entity may change type in an upgrade, but none may go. Claude-Session: https://claude.ai/code/session_013sC1p4dJXjteytbxDXnk5g Co-authored-by: Adeel Ahmad <noreply@anthropic.com>
20 of 22 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: almost every entity analysis found was a Term. The default rules extractor typed a capitalised name as a person only after a title (Dr, Mr), as an organisation only before Inc/Corp-like words and as a product only with a digit; people, places and most organisations all came out as Term.
After: names get their real types without any model.
app/domain/name_types.pyreads each name and the words around it:Existing installs: upgrade step
entity-typestypes the Terms analysis made, from their names and the lines that mention them. Types people or agents set (found in the graph history and the audit log), entities on a fixed list, hidden ones, Unknown and Unlabeled are left alone. The changes are recorded asentity.typedevents ("Gave a type to") in the graph history, so they can be rolled back.Motivation and Context
Adeel: "every entity comes as term? why!!"
Steps to reproduce (if appropriate):
Before this PR,
analyze.extract_entities("Yesterday I met Sarah Johnson in London to talk about the Google deal.")gave[('Sarah Johnson', 'TERM'), ('London', 'TERM'), ('Google', 'TERM')]. It now givesPERSON,PLACE,ORG.Types of changes
!in the title)Checklist:
make hookschecks it on commit).tests/domain/test_name_types.py; tests that expected Berlin or Amazon Web Services to be Terms now expect their real types).docs/accordingly (processing.md "How a name gets its type", graph-history.md op list).## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
Name | TYPE) still wins over the rules; with spaCy picked, spaCy's types are used.entity-typesstep, safe to run twice (tested).entity_finderand graph history events; no new library.Local CI (
ci/local-ci.sh) on the merged head: backend, Next.js, pre-commit and title pass.🤖 Generated with Claude Code
https://claude.ai/code/session_018MeaEgM8m7rTjbkKVQVsrT