Integrate Proteus alignment pipeline into align.py; document in README#22
Merged
Merged
Conversation
Rewrites neuro_ghost/align.py to implement the full six-stage Proteus alignment pipeline inline (no external proteus_align import): - Stage 0: load_classes() builds MatchingProfiles from LadybugDB, now including units from HAS_PROPERTY edges - Stage 1: pairs_across_sources() candidate blocking + hard unit veto (UCUM→QUDT dimensional veto — the only precision filter at stage 1) - Stage 2: compute_signals() produces a frozen SignalVector per pair; absent signals are None (MISSING), never zero-imputed - Stage 3: calibrate() weights present signals (W_NAME=0.45, W_JACCARD=0.35, W_ALIAS=0.20), blends definition cosine at 25%, adds UNIT_BONUS=0.05 for compatible dimensions - Stage 4: assign_predicate() two-pathway: anchored (IRI) can reach exactMatch/broadMatch/narrowMatch; statistical caps at closeMatch - Stage 5: repair_structural() demotes duplicate exactMatch to closeMatch - Stage 6: write_alignment() writes ALIGNED_TO edges with distance, skos_relation, method, and per-signal subscores Also inlines _lexical.py (tokenization, Jaccard, string_sim) and units.py (UCUM→QUDT dimension table). Definition embeddings (M3) are implemented via sentence-transformers all-MiniLM-L6-v2, cached in data/embeddings.parquet. README: adds alignment pipeline table, fixes stale distance formula. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EXeTeJsXisxTRXay6EoBSQ
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.
Rewrites neuro_ghost/align.py to implement the full six-stage Proteus alignment pipeline inline (no external proteus_align import):
Also inlines _lexical.py (tokenization, Jaccard, string_sim) and units.py (UCUM→QUDT dimension table). Definition embeddings (M3) are implemented via sentence-transformers all-MiniLM-L6-v2, cached in data/embeddings.parquet.
README: adds alignment pipeline table, fixes stale distance formula.
Claude-Session: https://claude.ai/code/session_01EXeTeJsXisxTRXay6EoBSQ