Skip to content

CU-8698mx1ua add two step linker #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

mart-r
Copy link
Collaborator

@mart-r mart-r commented Apr 7, 2025

This PR adds a 2-step linker.

The 2-step linker uses an extra step before dealing with CUIs directly.
Namely, it deals with Type IDs.

The approach uses the existing ContextModel to create context vectors for type IDs:

  • It adds type IDs to the cdb.cui2info dict with a prefix for the key
  • It uses a separate instance of ContextModel to add context vectors to TypeIDs during training

When doing unsupervised training:

  • It checks all the possible TUIs for a given NER'd name
  • If there's only 1 TUI, train on that
  • If there's more than 1 TUI, trains the TUI(s) assigned to the CUI that is 'primary' for the NER'd name
  • Only after that, refers to the regular linker to train the CUI

When doing supervised training:

  • Trains for the TUI(s) assigned to the CUI that was annotated
  • Refers to regular linker to train the CUI

When doing inference

  • Narrows each entity down to the CUIs that correspond to the most likely type ID as per trained concept vectors
    • If the similarity is not good enough (as per the config), nothing is changed
    • If the most-likely type ID is determined, only CUIs that have that type ID are kept
  • Refers to the regular linker to do inference on the (possible/hopefully) narrowed list of CUIs

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.

1 participant