Skip to content

feat(medcat): CPDT-223 Add failure modes to get stats - #627

Open
mart-r wants to merge 45 commits into
mainfrom
feat/medcat/CPDT-223-add-failure-modes-to-get-stats
Open

mart-r wants to merge 45 commits into
mainfrom
feat/medcat/CPDT-223-add-failure-modes-to-get-stats

Conversation

@mart-r

@mart-r mart-r commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

This PR (optionally) adds failure modes to false negatives in the output of the get_stats method.

The list of failure modes used is in the source, but I'll bring it up here as well for clarity:

List of failure modes and their brief descriptions

Copied from code as of 2026-10-06 at 15-59.

class FailureMode(str, Enum):
    """Why a gold-standard annotation was not predicted (false negative).

    Each FN is assigned exactly ONE mode. Evaluated in this order; the first
    matching mode wins:

        0. gold sanity             (SPAN_INCORRECT_FOR_VALUE)
        1. concept / name lookup   (CUI_NOT_IN_CDB .. NAME_NOT_LINKED_TO_CUI)
        2. NER                     (NER_NO_SPAN)
        3. filters                 (FILTERED_*)
        4. disambiguation          (WRONG_CONCEPT_*)
        5. span                    (SPAN_*)
        6. thresholding            (BELOW_THRESHOLD)
        7. fallback                (UNKNOWN)

    Filters are checked before disambiguation because a filtered-out gold
    concept is removed from the candidates, which would otherwise show up as
    a (misleading) disambiguation failure.

    Hierarchy-based modes need a concept hierarchy (e.g. SNOMED is-a). With
    no hierarchy (custom ontology) use WRONG_CONCEPT_UNRELATED.
    """

    # --- 0. Gold sanity -----------------------------------------------
    SPAN_INCORRECT_FOR_VALUE = "span_incorrect_for_value"
    """The span start/end index did not match the value specified by the
    annotation. This is normally due to some preprocessing somewhere. Not a
    model failure, and nothing else can be said about such an annotation."""

    # --- 1. Concept / name lookup -------------------------------------
    CUI_NOT_IN_CDB = "cui_not_in_cdb"
    """The gold concept does not exist in the CDB at all, so no name can
    reach it (e.g. CDB built from a subset of the ontology)."""

    NAME_UNKNOWN = "name_unknown"
    """The surface text (after normalisation) is not a known name in the CDB
    for any concept."""

    NAME_NOT_LINKED_TO_CUI = "name_not_linked_to_cui"
    """The name is in the CDB, but only maps to other concepts. The gold
    concept was never a candidate, so disambiguation could not select it."""

    # --- 2. NER ---------------------------------------------------------
    NER_NO_SPAN = "ner_no_span"
    """The name is in the CDB and maps to the gold concept, but the NER step
    never proposed a span. Typical causes: tokenisation boundary mismatch,
    normalisation, case sensitivity (e.g. abbreviations), min name length,
    or too many skipped tokens in a multi-word name."""

    # --- 3. Filters -----------------------------------------------------
    FILTERED_DISALLOW_LIST = "filtered_disallow_list"
    """The gold concept is explicitly excluded by a disallow list / exclude
    filter."""

    FILTERED_NOT_IN_ALLOW_LIST = "filtered_not_in_allow_list"
    """An allow list / include filter is active and the gold concept is not
    in it."""

    # --- 4. Disambiguation (gold concept was a candidate, other chosen) --
    WRONG_CONCEPT_DIRECT_PARENT = "wrong_concept_direct_parent"
    """The direct parent of the concept was predicted instead of the expected
    (more specific) gold concept."""
    WRONG_CONCEPT_ANCESTOR = "wrong_concept_ancestor"
    """A more general concept (ancestor of the gold concept) was predicted
    instead. Record the hierarchy distance as metadata."""

    WRONG_CONCEPT_DIRECT_CHILD = "wrong_concept_direct_child"
    """The direct child of the concept was predicted instead of the expected
    (more general) gold concept."""

    WRONG_CONCEPT_DESCENDANT = "wrong_concept_descendant"
    """A more specific concept (descendant of the gold concept) was predicted
    instead. Record the hierarchy distance as metadata."""

    WRONG_CONCEPT_SIBLING = "wrong_concept_sibling"
    """A concept sharing a direct parent with the gold concept was predicted
    instead."""

    WRONG_CONCEPT_UNRELATED = "wrong_concept_unrelated"
    """A concept with no known hierarchical relation to the gold concept was
    predicted instead (or no hierarchy is available)."""

    # --- 5. Span --------------------------------------------------------
    SPAN_PRED_CONTAINS_GOLD = "span_pred_contains_gold"
    """Right concept, but the predicted span is longer: it fully contains the
    gold span."""

    SPAN_GOLD_CONTAINS_PRED = "span_gold_contains_pred"
    """Right concept, but the predicted span is shorter: it lies fully inside
    the gold span."""

    SPAN_PARTIAL_OVERLAP = "span_partial_overlap"
    """Right concept, but the predicted span is shifted: it overlaps the gold
    span without either containing the other."""

    # --- 6. Thresholding -----------------------------------------------
    BELOW_THRESHOLD = "below_threshold"
    """The gold concept was not chosen due to its linking score being below
    the acceptance threshold. We cannot tell for certain if there were other
    concepts that were higher in linking score at this stage. Store the score
    margin and the concept's training count as metadata to tell 'needs more
    training data' apart from 'close to the threshold'."""

    # --- 7. Fallback ----------------------------------------------------
    UNKNOWN = "unknown"
    """No mode above explains the miss (includes possible gold-annotation
    errors such as bad offsets or labels)."""

The idea would be that if the model fails to corectly identify a specific concept, this should help identify why the specific issues are.

For reference, with the following code:

stats = get_stats(
    cat, data, do_print=True, use_project_filters=True,
    include_failure_modes=True,
)
examples = stats[-1]
summarise_failure_modes(
    cat, examples, print_mode='totals',
)

and the 2025 model running against the Snomed CT Entity Linking challenge dataset, we get the output of:

All failure modes
{<FM.BELOW_THRESHOLD>: 4269,
 <FM.CUI_NOT_IN_CDB>: 358,
 <FM.NAME_NOT_LINKED_TO_CUI>: 13892,
 <FM.NAME_UNKNOWN>: 12969,
 <FM.NER_NO_SPAN>: 149,
 <FM.SPAN_GOLD_CONTAINS_PRED>: 2,
 <FM.SPAN_INCORRECT_FOR_VALUE>: 129,
 <FM.SPAN_PARTIAL_OVERLAP>: 34,
 <FM.SPAN_PRED_CONTAINS_GOLD>: 46,
 <FM.WRONG_CONCEPT_ANCESTOR>: 36,
 <FM.WRONG_CONCEPT_DESCENDANT>: 31,
 <FM.WRONG_CONCEPT_DIRECT_CHILD>: 313,
 <FM.WRONG_CONCEPT_DIRECT_PARENT>: 103,
 <FM.WRONG_CONCEPT_SIBLING>: 22,
 <FM.WRONG_CONCEPT_UNRELATED>: 433}

There are a number of options, some of which allow a lot more informaton to be shown in terms of the examples.

I will give a short example of more detailed output for 1 document from the same dataset

The code used was almost the same:

stats = get_stats(
    cat, data, do_print=True, use_project_filters=True,
    include_failure_modes=True,
)
examples = stats[-1]
summarise_failure_modes(
    cat, examples, print_mode='all',  # only difference is the print mode
    include_details_for_examples_max=1,  # and the details level
                                     # with this seting, if a category has 1 example, then it is shown in detail
                                     # otherwise only the number of examples is shown
)

And the output we get (only in terms of summarisation) is:

Per type ID failure modes
{'102599008': {<FM.NAME_UNKNOWN>: [{'context': 'scopic incisions open to air with dermabond and c/d/i\n'
                                               'EXTR: >>>Warm<<<, +pp, no c/c/e\n'
                                               ' \n'
                                               'Pertinent Results:\n'
                                               'Pathology: Pending\n'
                                               ' \n'
                                               'Br',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'Warm'}]},
 '102834005': {<FM.NAME_UNKNOWN>: [{'context': ' was well controlled. Diet was tolerated well. The patient \n'
                                               '>>>voided without problem<<<. The patient received subcutaneous \n'
                                               'heparin and venodyne bo',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'voided without problem'}]},
 '103744005': {<FM.NAME_UNKNOWN>: [{'context': ' patient arrived on the floor tolerating regular \n'
                                               'diet , on >>>IV fluids<<<, and Dilaudid PCA for pain control.  The \n'
                                               'patient was hemod',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'IV fluids'}]},
 '103746007': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': '\n'
                                                         'voided without problem. The patient received subcutaneous \n'
                                                         '>>>heparin<<< and venodyne boots were used during this '
                                                         'stay.\n'
                                                         'At the time ',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'heparin'}]},
 '1156446004': {<FM.NAME_UNKNOWN>: 2},
 '118227000': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': ' pancreatic malignancy  \n'
                                                         '\n'
                                                         ' \n'
                                                         'Physical Exam:\n'
                                                         'Prior Discharge:\n'
                                                         '>>>VS<<<: 98.3, 83, 137/69, 16, 98% RA\n'
                                                         'GEN: NAD, AAO x 3\n'
                                                         'CV: RRR\n'
                                                         'PUL',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'VS'}]},
 '122865005': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'een \n'
                                                         'drained through a minimally invasive approach into his >>>GI '
                                                         'tract<<<. \n'
                                                         ' He has some debris, but this is not currently infected. ',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'GI tract'}]},
 '129023004': {<FM.NAME_UNKNOWN>: [{'context': 'ns. The patient was tolerating a regular \n'
                                               'diet, ambulating, >>>voiding without assistance<<<, and pain was '
                                               'well \n'
                                               'controlled.  The patient was discharged',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'voiding without assistance'}]},
 '160680006': {<FM.NAME_UNKNOWN>: [{'context': 'le vital signs. The patient was tolerating a regular \n'
                                               'diet, >>>ambulating<<<, voiding without assistance, and pain was '
                                               'well \n'
                                               'controlled.',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'ambulating'}]},
 '162673000': {<FM.NAME_UNKNOWN>: [{'context': 'cal Exam:\n'
                                               'Prior Discharge:\n'
                                               'VS: 98.3, 83, 137/69, 16, 98% RA\n'
                                               '>>>GEN<<<: NAD, AAO x 3\n'
                                               'CV: RRR\n'
                                               'PULM: CTAB\n'
                                               'ABD: Laparoscopic incision',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'GEN'}]},
 '165245003': {<FM.NAME_UNKNOWN>: [{'context': 'l of Consciousness: Alert and interactive.\n'
                                               'Activity Status: >>>Ambulatory - Independent<<<.\n'
                                               '\n'
                                               ' \n'
                                               'Discharge Instructions:\n'
                                               'You were admitted to the surger',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'Ambulatory - Independent'}]},
 '1835003': {<FM.WRONG_CONCEPT_UNRELATED>: [{'context': 'a ___ man who had severe biliary \n'
                                                        'pancreatitis resulting in >>>pancreatic necrosis<<< for which '
                                                        'he was \n'
                                                        'treated with nasojejunal feedings and pan',
                                             'document_id': '10060142-DS-9',
                                             'document_name': 'LC2023_10060142-DS-9_2',
                                             'project_id': 'LC2023',
                                             'project_name': 'linking-challenge-2023-2',
                                             'source_val': 'pancreatic necrosis'}]},
 '183616001': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'ids.  Avoid lifting \n'
                                                         'weights greater than ___ lbs until you >>>follow-up<<< with '
                                                         'your \n'
                                                         'surgeon, who will instruct you further regarding',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'follow-up'}]},
 '19387007': {<FM.NAME_UNKNOWN>: [{'context': 'sis for which he was \n'
                                              'treated with nasojejunal feedings and >>>pancreatic rest<<<.  He had \n'
                                              'initially had multisystem organ failure, which im',
                                   'document_id': '10060142-DS-9',
                                   'document_name': 'LC2023_10060142-DS-9_2',
                                   'project_id': 'LC2023',
                                   'project_name': 'linking-challenge-2023-2',
                                   'source_val': 'pancreatic rest'}]},
 '19585003': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'l \n'
                                                        'resection of your gallbladder. You have done well in the '
                                                        '>>>post \n'
                                                        'operative<<< period and are now safe to return home to '
                                                        'complete \n'
                                                        'your re',
                                             'document_id': '10060142-DS-9',
                                             'document_name': 'LC2023_10060142-DS-9_2',
                                             'project_id': 'LC2023',
                                             'project_name': 'linking-challenge-2023-2',
                                             'source_val': 'post \noperative'}]},
 '225162003': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': '83, 137/69, 16, 98% RA\n'
                                                         'GEN: NAD, AAO x 3\n'
                                                         'CV: RRR\n'
                                                         'PULM: CTAB\n'
                                                         '>>>ABD<<<: Laparoscopic incisions open to air with dermabond '
                                                         'and c/d/',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'ABD'}]},
 '230690007': {<FM.WRONG_CONCEPT_UNRELATED>: [{'context': '\n'
                                                          'Mother passed of metastatic lung cancer. Father alive, had '
                                                          '>>>CVA<<< \n'
                                                          'and MI.  No  history of pancreatic malignancy  \n'
                                                          '\n'
                                                          ' \n'
                                                          'Physica',
                                               'document_id': '10060142-DS-9',
                                               'document_name': 'LC2023_10060142-DS-9_2',
                                               'project_id': 'LC2023',
                                               'project_name': 'linking-challenge-2023-2',
                                               'source_val': 'CVA'}]},
 '248234008': {<FM.BELOW_THRESHOLD>: [{'context': '\n'
                                                  'Mental Status: Clear and coherent.\n'
                                                  'Level of Consciousness: >>>Alert<<< and interactive.\n'
                                                  'Activity Status: Ambulatory - Independent.',
                                       'document_id': '10060142-DS-9',
                                       'document_name': 'LC2023_10060142-DS-9_2',
                                       'project_id': 'LC2023',
                                       'project_name': 'linking-challenge-2023-2',
                                       'source_val': 'Alert'}]},
 '268910001': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'st.  He had \n'
                                                         'initially had multisystem organ failure, which '
                                                         '>>>improved<<<. Mr. \n'
                                                         '___ has a large postnecrotic pseudocyst, which has be',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'improved'}]},
 '268925001': {<FM.NAME_UNKNOWN>: [{'context': '\n'
                                               'VS: 98.3, 83, 137/69, 16, 98% RA\n'
                                               'GEN: NAD, AAO x 3\n'
                                               'CV: RRR\n'
                                               '>>>PULM<<<: CTAB\n'
                                               'ABD: Laparoscopic incisions open to air with dermabon',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'PULM'}]},
 '288577006': {<FM.NAME_UNKNOWN>: [{'context': 'atus: Clear and coherent.\n'
                                               'Level of Consciousness: Alert and >>>interactive<<<.\n'
                                               'Activity Status: Ambulatory - Independent.\n'
                                               '\n'
                                               ' \n'
                                               'Discharge In',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'interactive'}]},
 '302773001': {<FM.NAME_UNKNOWN>: [{'context': 'Laparoscopic incisions open to air with dermabond and c/d/i\n'
                                               '>>>EXTR<<<: Warm, +pp, no c/c/e\n'
                                               ' \n'
                                               'Pertinent Results:\n'
                                               'Pathology: Pendin',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'EXTR'}]},
 '304673006': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'imming and baths until your follow-up appointment.\n'
                                                         '*You may >>>shower<<<, and wash surgical incisions with a '
                                                         'mild soap \n'
                                                         'and warm wat',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'shower'}],
               <FM.NAME_UNKNOWN>: 2},
 '310500000': {<FM.NAME_UNKNOWN>: [{'context': 'tient was hemodynamically stable.\n'
                                               'Pain was well controlled. >>>Diet was tolerated well<<<. The patient \n'
                                               'voided without problem. The patient received ',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'Diet was tolerated well'}]},
 '311401005': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'rged home without services. \n'
                                                         'The patient received discharge >>>teaching<<< and '
                                                         'follow-up \n'
                                                         'instructions with understanding verbalized a',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'teaching'}]},
 '313210009': {<FM.NAME_UNKNOWN>: [{'context': 'y of rest, continue to ambulate several times \n'
                                               'per day, and >>>drink adequate amounts of fluids<<<.  Avoid lifting \n'
                                               'weights greater than ___ lbs until you fol',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'drink adequate amounts of fluids'}]},
 '32849002': {<FM.BELOW_THRESHOLD>: [{'context': 'tectomy on ___.\n'
                                                 ' \n'
                                                 'Past Medical History:\n'
                                                 'Hiatal Hernia  \n'
                                                 '___ >>>esophagus<<<  \n'
                                                 'Esophageal ulcer  \n'
                                                 'anxiety  \n'
                                                 'Back pain \n'
                                                 ' \n'
                                                 'Social History:',
                                      'document_id': '10060142-DS-9',
                                      'document_name': 'LC2023_10060142-DS-9_2',
                                      'project_id': 'LC2023',
                                      'project_name': 'linking-challenge-2023-2',
                                      'source_val': 'esophagus'}]},
 '3415004': {<FM.NAME_UNKNOWN>: [{'context': 'ns open to air with dermabond and c/d/i\n'
                                             'EXTR: Warm, +pp, no >>>c<<</c/e\n'
                                             ' \n'
                                             'Pertinent Results:\n'
                                             'Pathology: Pending\n'
                                             ' \n'
                                             'Brief Hospita',
                                  'document_id': '10060142-DS-9',
                                  'document_name': 'LC2023_10060142-DS-9_2',
                                  'project_id': 'LC2023',
                                  'project_name': 'linking-challenge-2023-2',
                                  'source_val': 'c'}]},
 '359665005': {<FM.NAME_UNKNOWN>: [{'context': 'tions as prescribed.\n'
                                               'Please get plenty of rest, continue to >>>ambulate<<< several times \n'
                                               'per day, and drink adequate amounts of fluid',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'ambulate'}]},
 '363003006': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'scharge:\n'
                                                         'VS: 98.3, 83, 137/69, 16, 98% RA\n'
                                                         'GEN: NAD, AAO x 3\n'
                                                         '>>>CV<<<: RRR\n'
                                                         'PULM: CTAB\n'
                                                         'ABD: Laparoscopic incisions open to air wit',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'CV'}]},
 '363418001': {<FM.NAME_UNKNOWN>: [{'context': 'lung cancer. Father alive, had CVA \n'
                                               'and MI.  No  history of >>>pancreatic malignancy<<<  \n'
                                               '\n'
                                               ' \n'
                                               'Physical Exam:\n'
                                               'Prior Discharge:\n'
                                               'VS: 98.3, 83, 137/69, ',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'pancreatic malignancy'}]},
 '36823005': {<FM.WRONG_CONCEPT_DIRECT_PARENT>: [{'context': 'y in \n'
                                                             'the PACU, the patient arrived on the floor tolerating '
                                                             '>>>regular \n'
                                                             'diet<<< , on IV fluids, and Dilaudid PCA for pain '
                                                             'control.  The \n'
                                                             'pa',
                                                  'document_id': '10060142-DS-9',
                                                  'document_name': 'LC2023_10060142-DS-9_2',
                                                  'project_id': 'LC2023',
                                                  'project_name': 'linking-challenge-2023-2',
                                                  'source_val': 'regular \ndiet'}]},
 '38102005': {<FM.NAME_UNKNOWN>: [{'context': 'ctions:\n'
                                              'You were admitted to the surgery service at ___ for >>>surgical \n'
                                              'resection of your gallbladder<<<. You have done well in the post \n'
                                              'operative period and are n',
                                   'document_id': '10060142-DS-9',
                                   'document_name': 'LC2023_10060142-DS-9_2',
                                   'project_id': 'LC2023',
                                   'project_name': 'linking-challenge-2023-2',
                                   'source_val': 'surgical \nresection of your gallbladder'}]},
 '386390005': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'pic cholecystectomy. After a brief, uneventful stay in \n'
                                                         'the >>>PACU<<<, the patient arrived on the floor tolerating '
                                                         'regular \n'
                                                         'diet ',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'PACU'}]},
 '386661006': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'stay.\n'
                                                         'At the time of discharge, the patient was doing well, '
                                                         '>>>afebrile<<< \n'
                                                         'with stable vital signs. The patient was tolerating a regu',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'afebrile'}]},
 '392257007': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'rge Diagnosis:\n'
                                                         'Biliary pancreatitis\n'
                                                         '\n'
                                                         ' \n'
                                                         'Discharge Condition:\n'
                                                         '>>>Mental Status<<<: Clear and coherent.\n'
                                                         'Level of Consciousness: Alert and inte',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'Mental Status'}]},
 '394835006': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': ' \n'
                                                         '___ and ask to ___ team.\n'
                                                         '.\n'
                                                         'Please resume all regular home >>>medications<<< , unless '
                                                         'specifically \n'
                                                         'advised not to take a particular med',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'medications'}],
               <FM.NAME_UNKNOWN>: [{'context': 'y \n'
                                               'restrictions.\n'
                                               'Avoid driving or operating heavy machinery >>>while taking pain \n'
                                               'medications<<<.\n'
                                               'Please follow-up with your surgeon and Primary Care Provid',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'while taking pain \nmedications'}]},
 '420227002': {<FM.NAME_UNKNOWN>: [{'context': 'es. \n'
                                               'The patient received discharge teaching and follow-up \n'
                                               '>>>instructions<<< with understanding verbalized and agreement with \n'
                                               'the disch',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'instructions'}]},
 '424372002': {<FM.NAME_UNKNOWN>: [{'context': 'pen to air with dermabond and c/d/i\n'
                                               'EXTR: Warm, +pp, no c/c/>>>e<<<\n'
                                               ' \n'
                                               'Pertinent Results:\n'
                                               'Pathology: Pending\n'
                                               ' \n'
                                               'Brief Hospital Co',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'e'}]},
 '442672001': {<FM.BELOW_THRESHOLD>: [{'context': 'r doctor or nurse practitioner if you have \n'
                                                  'increased pain, >>>swelling<<<, redness, or drainage from the '
                                                  'incision \n'
                                                  'site.\n'
                                                  '*Avoid swimm',
                                       'document_id': '10060142-DS-9',
                                       'document_name': 'LC2023_10060142-DS-9_2',
                                       'project_id': 'LC2023',
                                       'project_name': 'linking-challenge-2023-2',
                                       'source_val': 'swelling'}]},
 '444714004': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': '\n'
                                                         '\n'
                                                         ' \n'
                                                         'Discharge Condition:\n'
                                                         'Mental Status: Clear and coherent.\n'
                                                         '>>>Level of Consciousness<<<: Alert and interactive.\n'
                                                         'Activity Status: Ambulatory - Indep',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'Level of Consciousness'}]},
 '48348007': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': '8.3, 83, 137/69, 16, 98% RA\n'
                                                        'GEN: NAD, AAO x 3\n'
                                                        'CV: RRR\n'
                                                        'PULM: >>>CTAB<<<\n'
                                                        'ABD: Laparoscopic incisions open to air with dermabond and ',
                                             'document_id': '10060142-DS-9',
                                             'document_name': 'LC2023_10060142-DS-9_2',
                                             'project_id': 'LC2023',
                                             'project_name': 'linking-challenge-2023-2',
                                             'source_val': 'CTAB'}]},
 '51316009': {<FM.CUI_NOT_IN_CDB>: [{'context': '37/69, 16, 98% RA\n'
                                                'GEN: NAD, AAO x 3\n'
                                                'CV: RRR\n'
                                                'PULM: CTAB\n'
                                                'ABD: >>>Laparoscopic<<< incisions open to air with dermabond and '
                                                'c/d/i\n'
                                                'EXTR: Warm, ',
                                     'document_id': '10060142-DS-9',
                                     'document_name': 'LC2023_10060142-DS-9_2',
                                     'project_id': 'LC2023',
                                     'project_name': 'linking-challenge-2023-2',
                                     'source_val': 'Laparoscopic'}]},
 '56783008': {<FM.NAME_UNKNOWN>: [{'context': '. \n'
                                              '___ has a large postnecrotic pseudocyst, which has been \n'
                                              '>>>drained<<< through a minimally invasive approach into his GI '
                                              'tract. \n'
                                              ' ',
                                   'document_id': '10060142-DS-9',
                                   'document_name': 'LC2023_10060142-DS-9_2',
                                   'project_id': 'LC2023',
                                   'project_name': 'linking-challenge-2023-2',
                                   'source_val': 'drained'}]},
 '609343002': {<FM.NAME_NOT_LINKED_TO_CUI>: 3},
 '722742002': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'ysical Exam:\n'
                                                         'Prior Discharge:\n'
                                                         'VS: 98.3, 83, 137/69, 16, 98% >>>RA<<<\n'
                                                         'GEN: NAD, AAO x 3\n'
                                                         'CV: RRR\n'
                                                         'PULM: CTAB\n'
                                                         'ABD: Laparoscopic inci',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'RA'}]},
 '72970002': {<FM.NAME_UNKNOWN>: [{'context': 'me of discharge, the patient was doing well, afebrile \n'
                                              'with >>>stable vital signs<<<. The patient was tolerating a regular \n'
                                              'diet, ambulating, vo',
                                   'document_id': '10060142-DS-9',
                                   'document_name': 'LC2023_10060142-DS-9_2',
                                   'project_id': 'LC2023',
                                   'project_name': 'linking-challenge-2023-2',
                                   'source_val': 'stable vital signs'}]},
 '737470001': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'ase follow-up with your surgeon and Primary Care Provider \n'
                                                         '(>>>PCP<<<) as advised.\n'
                                                         'Incision Care:\n'
                                                         '*Please call your doctor or nur',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'PCP'}],
               <FM.NAME_UNKNOWN>: [{'context': 'g pain \n'
                                               'medications.\n'
                                               'Please follow-up with your surgeon and >>>Primary Care<<< Provider \n'
                                               '(PCP) as advised.\n'
                                               'Incision Care:\n'
                                               '*Please call you',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'Primary Care'}]},
 '737492002': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': ' infected. The \n'
                                                         'patient was followed by Dr. ___ in his ___ \n'
                                                         '>>>clinic<<< to discuss cholecystectomy. After discussion of '
                                                         'all \n'
                                                         'risks,',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'clinic'}]},
 '75823008': {<FM.WRONG_CONCEPT_UNRELATED>: [{'context': 'titioner if you have \n'
                                                         'increased pain, swelling, redness, or >>>drainage<<< from '
                                                         'the incision \n'
                                                         'site.\n'
                                                         '*Avoid swimming and baths until yo',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'drainage'}]},
 '76863003': {<FM.NAME_UNKNOWN>: [{'context': 'rge:\n'
                                              'VS: 98.3, 83, 137/69, 16, 98% RA\n'
                                              'GEN: NAD, AAO x 3\n'
                                              'CV: >>>RRR<<<\n'
                                              'PULM: CTAB\n'
                                              'ABD: Laparoscopic incisions open to air with der',
                                   'document_id': '10060142-DS-9',
                                   'document_name': 'LC2023_10060142-DS-9_2',
                                   'project_id': 'LC2023',
                                   'project_name': 'linking-challenge-2023-2',
                                   'source_val': 'RRR'}]},
 '822962003': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'r nurse practitioner if you have \n'
                                                         'increased pain, swelling, >>>redness<<<, or drainage from '
                                                         'the incision \n'
                                                         'site.\n'
                                                         '*Avoid swimming and b',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'redness'}]},
 '91936005': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': '  ___             Sex:   M\n'
                                                        ' \n'
                                                        'Service: SURGERY\n'
                                                        ' \n'
                                                        'Allergies: \n'
                                                        '>>>Penicillins<<<\n'
                                                        ' \n'
                                                        'Attending: ___.\n'
                                                        ' \n'
                                                        'Chief Complaint:\n'
                                                        'Biliary pancreatitis\n'
                                                        ' ',
                                             'document_id': '10060142-DS-9',
                                             'document_name': 'LC2023_10060142-DS-9_2',
                                             'project_id': 'LC2023',
                                             'project_name': 'linking-challenge-2023-2',
                                             'source_val': 'Penicillins'}]},
 '95563007': {<FM.NAME_UNKNOWN>: 3},
 '967006': {<FM.NAME_NOT_LINKED_TO_CUI>: 2}}
Per CUI failure modes
{'102599008': {<FM.NAME_UNKNOWN>: [{'context': 'scopic incisions open to air with dermabond and c/d/i\n'
                                               'EXTR: >>>Warm<<<, +pp, no c/c/e\n'
                                               ' \n'
                                               'Pertinent Results:\n'
                                               'Pathology: Pending\n'
                                               ' \n'
                                               'Br',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'Warm'}]},
 '102834005': {<FM.NAME_UNKNOWN>: [{'context': ' was well controlled. Diet was tolerated well. The patient \n'
                                               '>>>voided without problem<<<. The patient received subcutaneous \n'
                                               'heparin and venodyne bo',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'voided without problem'}]},
 '103744005': {<FM.NAME_UNKNOWN>: [{'context': ' patient arrived on the floor tolerating regular \n'
                                               'diet , on >>>IV fluids<<<, and Dilaudid PCA for pain control.  The \n'
                                               'patient was hemod',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'IV fluids'}]},
 '103746007': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': '\n'
                                                         'voided without problem. The patient received subcutaneous \n'
                                                         '>>>heparin<<< and venodyne boots were used during this '
                                                         'stay.\n'
                                                         'At the time ',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'heparin'}]},
 '1156446004': {<FM.NAME_UNKNOWN>: 2},
 '118227000': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': ' pancreatic malignancy  \n'
                                                         '\n'
                                                         ' \n'
                                                         'Physical Exam:\n'
                                                         'Prior Discharge:\n'
                                                         '>>>VS<<<: 98.3, 83, 137/69, 16, 98% RA\n'
                                                         'GEN: NAD, AAO x 3\n'
                                                         'CV: RRR\n'
                                                         'PUL',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'VS'}]},
 '122865005': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'een \n'
                                                         'drained through a minimally invasive approach into his >>>GI '
                                                         'tract<<<. \n'
                                                         ' He has some debris, but this is not currently infected. ',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'GI tract'}]},
 '129023004': {<FM.NAME_UNKNOWN>: [{'context': 'ns. The patient was tolerating a regular \n'
                                               'diet, ambulating, >>>voiding without assistance<<<, and pain was '
                                               'well \n'
                                               'controlled.  The patient was discharged',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'voiding without assistance'}]},
 '160680006': {<FM.NAME_UNKNOWN>: [{'context': 'le vital signs. The patient was tolerating a regular \n'
                                               'diet, >>>ambulating<<<, voiding without assistance, and pain was '
                                               'well \n'
                                               'controlled.',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'ambulating'}]},
 '162673000': {<FM.NAME_UNKNOWN>: [{'context': 'cal Exam:\n'
                                               'Prior Discharge:\n'
                                               'VS: 98.3, 83, 137/69, 16, 98% RA\n'
                                               '>>>GEN<<<: NAD, AAO x 3\n'
                                               'CV: RRR\n'
                                               'PULM: CTAB\n'
                                               'ABD: Laparoscopic incision',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'GEN'}]},
 '165245003': {<FM.NAME_UNKNOWN>: [{'context': 'l of Consciousness: Alert and interactive.\n'
                                               'Activity Status: >>>Ambulatory - Independent<<<.\n'
                                               '\n'
                                               ' \n'
                                               'Discharge Instructions:\n'
                                               'You were admitted to the surger',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'Ambulatory - Independent'}]},
 '1835003': {<FM.WRONG_CONCEPT_UNRELATED>: [{'context': 'a ___ man who had severe biliary \n'
                                                        'pancreatitis resulting in >>>pancreatic necrosis<<< for which '
                                                        'he was \n'
                                                        'treated with nasojejunal feedings and pan',
                                             'document_id': '10060142-DS-9',
                                             'document_name': 'LC2023_10060142-DS-9_2',
                                             'project_id': 'LC2023',
                                             'project_name': 'linking-challenge-2023-2',
                                             'source_val': 'pancreatic necrosis'}]},
 '183616001': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'ids.  Avoid lifting \n'
                                                         'weights greater than ___ lbs until you >>>follow-up<<< with '
                                                         'your \n'
                                                         'surgeon, who will instruct you further regarding',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'follow-up'}]},
 '19387007': {<FM.NAME_UNKNOWN>: [{'context': 'sis for which he was \n'
                                              'treated with nasojejunal feedings and >>>pancreatic rest<<<.  He had \n'
                                              'initially had multisystem organ failure, which im',
                                   'document_id': '10060142-DS-9',
                                   'document_name': 'LC2023_10060142-DS-9_2',
                                   'project_id': 'LC2023',
                                   'project_name': 'linking-challenge-2023-2',
                                   'source_val': 'pancreatic rest'}]},
 '19585003': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'l \n'
                                                        'resection of your gallbladder. You have done well in the '
                                                        '>>>post \n'
                                                        'operative<<< period and are now safe to return home to '
                                                        'complete \n'
                                                        'your re',
                                             'document_id': '10060142-DS-9',
                                             'document_name': 'LC2023_10060142-DS-9_2',
                                             'project_id': 'LC2023',
                                             'project_name': 'linking-challenge-2023-2',
                                             'source_val': 'post \noperative'}]},
 '225162003': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': '83, 137/69, 16, 98% RA\n'
                                                         'GEN: NAD, AAO x 3\n'
                                                         'CV: RRR\n'
                                                         'PULM: CTAB\n'
                                                         '>>>ABD<<<: Laparoscopic incisions open to air with dermabond '
                                                         'and c/d/',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'ABD'}]},
 '230690007': {<FM.WRONG_CONCEPT_UNRELATED>: [{'context': '\n'
                                                          'Mother passed of metastatic lung cancer. Father alive, had '
                                                          '>>>CVA<<< \n'
                                                          'and MI.  No  history of pancreatic malignancy  \n'
                                                          '\n'
                                                          ' \n'
                                                          'Physica',
                                               'document_id': '10060142-DS-9',
                                               'document_name': 'LC2023_10060142-DS-9_2',
                                               'project_id': 'LC2023',
                                               'project_name': 'linking-challenge-2023-2',
                                               'source_val': 'CVA'}]},
 '248234008': {<FM.BELOW_THRESHOLD>: [{'context': '\n'
                                                  'Mental Status: Clear and coherent.\n'
                                                  'Level of Consciousness: >>>Alert<<< and interactive.\n'
                                                  'Activity Status: Ambulatory - Independent.',
                                       'document_id': '10060142-DS-9',
                                       'document_name': 'LC2023_10060142-DS-9_2',
                                       'project_id': 'LC2023',
                                       'project_name': 'linking-challenge-2023-2',
                                       'source_val': 'Alert'}]},
 '268910001': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'st.  He had \n'
                                                         'initially had multisystem organ failure, which '
                                                         '>>>improved<<<. Mr. \n'
                                                         '___ has a large postnecrotic pseudocyst, which has be',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'improved'}]},
 '268925001': {<FM.NAME_UNKNOWN>: [{'context': '\n'
                                               'VS: 98.3, 83, 137/69, 16, 98% RA\n'
                                               'GEN: NAD, AAO x 3\n'
                                               'CV: RRR\n'
                                               '>>>PULM<<<: CTAB\n'
                                               'ABD: Laparoscopic incisions open to air with dermabon',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'PULM'}]},
 '288577006': {<FM.NAME_UNKNOWN>: [{'context': 'atus: Clear and coherent.\n'
                                               'Level of Consciousness: Alert and >>>interactive<<<.\n'
                                               'Activity Status: Ambulatory - Independent.\n'
                                               '\n'
                                               ' \n'
                                               'Discharge In',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'interactive'}]},
 '302773001': {<FM.NAME_UNKNOWN>: [{'context': 'Laparoscopic incisions open to air with dermabond and c/d/i\n'
                                               '>>>EXTR<<<: Warm, +pp, no c/c/e\n'
                                               ' \n'
                                               'Pertinent Results:\n'
                                               'Pathology: Pendin',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'EXTR'}]},
 '304673006': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'imming and baths until your follow-up appointment.\n'
                                                         '*You may >>>shower<<<, and wash surgical incisions with a '
                                                         'mild soap \n'
                                                         'and warm wat',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'shower'}],
               <FM.NAME_UNKNOWN>: 2},
 '310500000': {<FM.NAME_UNKNOWN>: [{'context': 'tient was hemodynamically stable.\n'
                                               'Pain was well controlled. >>>Diet was tolerated well<<<. The patient \n'
                                               'voided without problem. The patient received ',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'Diet was tolerated well'}]},
 '311401005': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'rged home without services. \n'
                                                         'The patient received discharge >>>teaching<<< and '
                                                         'follow-up \n'
                                                         'instructions with understanding verbalized a',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'teaching'}]},
 '313210009': {<FM.NAME_UNKNOWN>: [{'context': 'y of rest, continue to ambulate several times \n'
                                               'per day, and >>>drink adequate amounts of fluids<<<.  Avoid lifting \n'
                                               'weights greater than ___ lbs until you fol',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'drink adequate amounts of fluids'}]},
 '32849002': {<FM.BELOW_THRESHOLD>: [{'context': 'tectomy on ___.\n'
                                                 ' \n'
                                                 'Past Medical History:\n'
                                                 'Hiatal Hernia  \n'
                                                 '___ >>>esophagus<<<  \n'
                                                 'Esophageal ulcer  \n'
                                                 'anxiety  \n'
                                                 'Back pain \n'
                                                 ' \n'
                                                 'Social History:',
                                      'document_id': '10060142-DS-9',
                                      'document_name': 'LC2023_10060142-DS-9_2',
                                      'project_id': 'LC2023',
                                      'project_name': 'linking-challenge-2023-2',
                                      'source_val': 'esophagus'}]},
 '3415004': {<FM.NAME_UNKNOWN>: [{'context': 'ns open to air with dermabond and c/d/i\n'
                                             'EXTR: Warm, +pp, no >>>c<<</c/e\n'
                                             ' \n'
                                             'Pertinent Results:\n'
                                             'Pathology: Pending\n'
                                             ' \n'
                                             'Brief Hospita',
                                  'document_id': '10060142-DS-9',
                                  'document_name': 'LC2023_10060142-DS-9_2',
                                  'project_id': 'LC2023',
                                  'project_name': 'linking-challenge-2023-2',
                                  'source_val': 'c'}]},
 '359665005': {<FM.NAME_UNKNOWN>: [{'context': 'tions as prescribed.\n'
                                               'Please get plenty of rest, continue to >>>ambulate<<< several times \n'
                                               'per day, and drink adequate amounts of fluid',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'ambulate'}]},
 '363003006': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'scharge:\n'
                                                         'VS: 98.3, 83, 137/69, 16, 98% RA\n'
                                                         'GEN: NAD, AAO x 3\n'
                                                         '>>>CV<<<: RRR\n'
                                                         'PULM: CTAB\n'
                                                         'ABD: Laparoscopic incisions open to air wit',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'CV'}]},
 '363418001': {<FM.NAME_UNKNOWN>: [{'context': 'lung cancer. Father alive, had CVA \n'
                                               'and MI.  No  history of >>>pancreatic malignancy<<<  \n'
                                               '\n'
                                               ' \n'
                                               'Physical Exam:\n'
                                               'Prior Discharge:\n'
                                               'VS: 98.3, 83, 137/69, ',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'pancreatic malignancy'}]},
 '36823005': {<FM.WRONG_CONCEPT_DIRECT_PARENT>: [{'context': 'y in \n'
                                                             'the PACU, the patient arrived on the floor tolerating '
                                                             '>>>regular \n'
                                                             'diet<<< , on IV fluids, and Dilaudid PCA for pain '
                                                             'control.  The \n'
                                                             'pa',
                                                  'document_id': '10060142-DS-9',
                                                  'document_name': 'LC2023_10060142-DS-9_2',
                                                  'project_id': 'LC2023',
                                                  'project_name': 'linking-challenge-2023-2',
                                                  'source_val': 'regular \ndiet'}]},
 '38102005': {<FM.NAME_UNKNOWN>: [{'context': 'ctions:\n'
                                              'You were admitted to the surgery service at ___ for >>>surgical \n'
                                              'resection of your gallbladder<<<. You have done well in the post \n'
                                              'operative period and are n',
                                   'document_id': '10060142-DS-9',
                                   'document_name': 'LC2023_10060142-DS-9_2',
                                   'project_id': 'LC2023',
                                   'project_name': 'linking-challenge-2023-2',
                                   'source_val': 'surgical \nresection of your gallbladder'}]},
 '386390005': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'pic cholecystectomy. After a brief, uneventful stay in \n'
                                                         'the >>>PACU<<<, the patient arrived on the floor tolerating '
                                                         'regular \n'
                                                         'diet ',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'PACU'}]},
 '386661006': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'stay.\n'
                                                         'At the time of discharge, the patient was doing well, '
                                                         '>>>afebrile<<< \n'
                                                         'with stable vital signs. The patient was tolerating a regu',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'afebrile'}]},
 '392257007': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'rge Diagnosis:\n'
                                                         'Biliary pancreatitis\n'
                                                         '\n'
                                                         ' \n'
                                                         'Discharge Condition:\n'
                                                         '>>>Mental Status<<<: Clear and coherent.\n'
                                                         'Level of Consciousness: Alert and inte',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'Mental Status'}]},
 '394835006': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': ' \n'
                                                         '___ and ask to ___ team.\n'
                                                         '.\n'
                                                         'Please resume all regular home >>>medications<<< , unless '
                                                         'specifically \n'
                                                         'advised not to take a particular med',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'medications'}],
               <FM.NAME_UNKNOWN>: [{'context': 'y \n'
                                               'restrictions.\n'
                                               'Avoid driving or operating heavy machinery >>>while taking pain \n'
                                               'medications<<<.\n'
                                               'Please follow-up with your surgeon and Primary Care Provid',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'while taking pain \nmedications'}]},
 '420227002': {<FM.NAME_UNKNOWN>: [{'context': 'es. \n'
                                               'The patient received discharge teaching and follow-up \n'
                                               '>>>instructions<<< with understanding verbalized and agreement with \n'
                                               'the disch',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'instructions'}]},
 '424372002': {<FM.NAME_UNKNOWN>: [{'context': 'pen to air with dermabond and c/d/i\n'
                                               'EXTR: Warm, +pp, no c/c/>>>e<<<\n'
                                               ' \n'
                                               'Pertinent Results:\n'
                                               'Pathology: Pending\n'
                                               ' \n'
                                               'Brief Hospital Co',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'e'}]},
 '442672001': {<FM.BELOW_THRESHOLD>: [{'context': 'r doctor or nurse practitioner if you have \n'
                                                  'increased pain, >>>swelling<<<, redness, or drainage from the '
                                                  'incision \n'
                                                  'site.\n'
                                                  '*Avoid swimm',
                                       'document_id': '10060142-DS-9',
                                       'document_name': 'LC2023_10060142-DS-9_2',
                                       'project_id': 'LC2023',
                                       'project_name': 'linking-challenge-2023-2',
                                       'source_val': 'swelling'}]},
 '444714004': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': '\n'
                                                         '\n'
                                                         ' \n'
                                                         'Discharge Condition:\n'
                                                         'Mental Status: Clear and coherent.\n'
                                                         '>>>Level of Consciousness<<<: Alert and interactive.\n'
                                                         'Activity Status: Ambulatory - Indep',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'Level of Consciousness'}]},
 '48348007': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': '8.3, 83, 137/69, 16, 98% RA\n'
                                                        'GEN: NAD, AAO x 3\n'
                                                        'CV: RRR\n'
                                                        'PULM: >>>CTAB<<<\n'
                                                        'ABD: Laparoscopic incisions open to air with dermabond and ',
                                             'document_id': '10060142-DS-9',
                                             'document_name': 'LC2023_10060142-DS-9_2',
                                             'project_id': 'LC2023',
                                             'project_name': 'linking-challenge-2023-2',
                                             'source_val': 'CTAB'}]},
 '51316009': {<FM.CUI_NOT_IN_CDB>: [{'context': '37/69, 16, 98% RA\n'
                                                'GEN: NAD, AAO x 3\n'
                                                'CV: RRR\n'
                                                'PULM: CTAB\n'
                                                'ABD: >>>Laparoscopic<<< incisions open to air with dermabond and '
                                                'c/d/i\n'
                                                'EXTR: Warm, ',
                                     'document_id': '10060142-DS-9',
                                     'document_name': 'LC2023_10060142-DS-9_2',
                                     'project_id': 'LC2023',
                                     'project_name': 'linking-challenge-2023-2',
                                     'source_val': 'Laparoscopic'}]},
 '56783008': {<FM.NAME_UNKNOWN>: [{'context': '. \n'
                                              '___ has a large postnecrotic pseudocyst, which has been \n'
                                              '>>>drained<<< through a minimally invasive approach into his GI '
                                              'tract. \n'
                                              ' ',
                                   'document_id': '10060142-DS-9',
                                   'document_name': 'LC2023_10060142-DS-9_2',
                                   'project_id': 'LC2023',
                                   'project_name': 'linking-challenge-2023-2',
                                   'source_val': 'drained'}]},
 '609343002': {<FM.NAME_NOT_LINKED_TO_CUI>: 3},
 '722742002': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'ysical Exam:\n'
                                                         'Prior Discharge:\n'
                                                         'VS: 98.3, 83, 137/69, 16, 98% >>>RA<<<\n'
                                                         'GEN: NAD, AAO x 3\n'
                                                         'CV: RRR\n'
                                                         'PULM: CTAB\n'
                                                         'ABD: Laparoscopic inci',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'RA'}]},
 '72970002': {<FM.NAME_UNKNOWN>: [{'context': 'me of discharge, the patient was doing well, afebrile \n'
                                              'with >>>stable vital signs<<<. The patient was tolerating a regular \n'
                                              'diet, ambulating, vo',
                                   'document_id': '10060142-DS-9',
                                   'document_name': 'LC2023_10060142-DS-9_2',
                                   'project_id': 'LC2023',
                                   'project_name': 'linking-challenge-2023-2',
                                   'source_val': 'stable vital signs'}]},
 '737470001': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'ase follow-up with your surgeon and Primary Care Provider \n'
                                                         '(>>>PCP<<<) as advised.\n'
                                                         'Incision Care:\n'
                                                         '*Please call your doctor or nur',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'PCP'}],
               <FM.NAME_UNKNOWN>: [{'context': 'g pain \n'
                                               'medications.\n'
                                               'Please follow-up with your surgeon and >>>Primary Care<<< Provider \n'
                                               '(PCP) as advised.\n'
                                               'Incision Care:\n'
                                               '*Please call you',
                                    'document_id': '10060142-DS-9',
                                    'document_name': 'LC2023_10060142-DS-9_2',
                                    'project_id': 'LC2023',
                                    'project_name': 'linking-challenge-2023-2',
                                    'source_val': 'Primary Care'}]},
 '737492002': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': ' infected. The \n'
                                                         'patient was followed by Dr. ___ in his ___ \n'
                                                         '>>>clinic<<< to discuss cholecystectomy. After discussion of '
                                                         'all \n'
                                                         'risks,',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'clinic'}]},
 '75823008': {<FM.WRONG_CONCEPT_UNRELATED>: [{'context': 'titioner if you have \n'
                                                         'increased pain, swelling, redness, or >>>drainage<<< from '
                                                         'the incision \n'
                                                         'site.\n'
                                                         '*Avoid swimming and baths until yo',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'drainage'}]},
 '76863003': {<FM.NAME_UNKNOWN>: [{'context': 'rge:\n'
                                              'VS: 98.3, 83, 137/69, 16, 98% RA\n'
                                              'GEN: NAD, AAO x 3\n'
                                              'CV: >>>RRR<<<\n'
                                              'PULM: CTAB\n'
                                              'ABD: Laparoscopic incisions open to air with der',
                                   'document_id': '10060142-DS-9',
                                   'document_name': 'LC2023_10060142-DS-9_2',
                                   'project_id': 'LC2023',
                                   'project_name': 'linking-challenge-2023-2',
                                   'source_val': 'RRR'}]},
 '822962003': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': 'r nurse practitioner if you have \n'
                                                         'increased pain, swelling, >>>redness<<<, or drainage from '
                                                         'the incision \n'
                                                         'site.\n'
                                                         '*Avoid swimming and b',
                                              'document_id': '10060142-DS-9',
                                              'document_name': 'LC2023_10060142-DS-9_2',
                                              'project_id': 'LC2023',
                                              'project_name': 'linking-challenge-2023-2',
                                              'source_val': 'redness'}]},
 '91936005': {<FM.NAME_NOT_LINKED_TO_CUI>: [{'context': '  ___             Sex:   M\n'
                                                        ' \n'
                                                        'Service: SURGERY\n'
                                                        ' \n'
                                                        'Allergies: \n'
                                                        '>>>Penicillins<<<\n'
                                                        ' \n'
                                                        'Attending: ___.\n'
                                                        ' \n'
                                                        'Chief Complaint:\n'
                                                        'Biliary pancreatitis\n'
                                                        ' ',
                                             'document_id': '10060142-DS-9',
                                             'document_name': 'LC2023_10060142-DS-9_2',
                                             'project_id': 'LC2023',
                                             'project_name': 'linking-challenge-2023-2',
                                             'source_val': 'Penicillins'}]},
 '95563007': {<FM.NAME_UNKNOWN>: 3},
 '967006': {<FM.NAME_NOT_LINKED_TO_CUI>: 2}}
All failure modes
{<FM.BELOW_THRESHOLD>: 3,
 <FM.CUI_NOT_IN_CDB>: [{'context': '37/69, 16, 98% RA\n'
                                   'GEN: NAD, AAO x 3\n'
                                   'CV: RRR\n'
                                   'PULM: CTAB\n'
                                   'ABD: >>>Laparoscopic<<< incisions open to air with dermabond and c/d/i\n'
                                   'EXTR: Warm, ',
                        'document_id': '10060142-DS-9',
                        'document_name': 'LC2023_10060142-DS-9_2',
                        'project_id': 'LC2023',
                        'project_name': 'linking-challenge-2023-2',
                        'source_val': 'Laparoscopic'}],
 <FM.NAME_NOT_LINKED_TO_CUI>: 26,
 <FM.NAME_UNKNOWN>: 31,
 <FM.WRONG_CONCEPT_DIRECT_PARENT>: [{'context': 'y in \n'
                                                'the PACU, the patient arrived on the floor tolerating >>>regular \n'
                                                'diet<<< , on IV fluids, and Dilaudid PCA for pain control.  The \n'
                                                'pa',
                                     'document_id': '10060142-DS-9',
                                     'document_name': 'LC2023_10060142-DS-9_2',
                                     'project_id': 'LC2023',
                                     'project_name': 'linking-challenge-2023-2',
                                     'source_val': 'regular \ndiet'}],
 <FM.WRONG_CONCEPT_UNRELATED>: 3}

A few caveats / questions / decisions:

  • Should we perhaps use the string representation of the Enum in the final output so as to allow easier serialisation?
  • Are there other things that we could add here to simplify the process of using this?

@adam-sutton-1992

Copy link
Copy Markdown
Contributor

Hi:

Should we perhaps use the string representation of the Enum in the final output so as to allow easier serialisation?

You could have a global constant dictionary of the conversion to and from for serialisation. I don't think it really matters.

Are there other things that we could add here to simplify the process of using this?

I can't think of any now. I thing the raw counts of each failure will be the level I go to for inspection / research. But maybe with usage I'll be able to have more insights.

@adam-sutton-1992 adam-sutton-1992 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Perhaps test it on examples from NER and Linking one pipelines?

@mart-r

mart-r commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator Author

LGTM - Perhaps test it on examples from NER and Linking one pipelines?

That lead me into a rabit hole to discover that this process kind of bricks the dataset aware implementation because it does postprocessing (i.e calls the pipe again) when determining some bits. So doing linker-only failure modes was just plain erroring out.

So thanks for pointing that out! I'll be able to implement a fix for this.

For reference, the "linker only failure modes" for this were:

All failure modes
{<FM.BELOW_THRESHOLD>: 23312,
 <FM.CUI_NOT_IN_CDB>: 358,
 <FM.NAME_NOT_LINKED_TO_CUI>: 14174,
 <FM.NAME_UNKNOWN>: 13391,
 <FM.NER_NO_SPAN>: 149,
 <FM.SPAN_INCORRECT_FOR_VALUE>: 190}

NOTE: the below threshold will also include a bunch for which the closest-similarity concept wasn't picked because it was outside the filter.

EDIT: when I do "ner only failure modes" (for 1 doc) with all print mode, I get:

Per type ID failure modes
{'DETECTED_ENTITY': {<FM.CUI_NOT_IN_CDB>: 44}}
Per CUI failure modes
{'DETECTED_ENTITY': {<FM.CUI_NOT_IN_CDB>: 44}}
All failure modes
{<FM.CUI_NOT_IN_CDB>: 44}

Looks like that's because of the DETECTED_ENTITY "cui".

EDIT2:
I've made some changes for the NER-only case and here's the results for the entire dataset now:

Per type ID failure modes
{'DETECTED_ENTITY': {<FM.NAME_UNKNOWN>: 11645, <FM.NER_NO_SPAN>: 15751, <FM.SPAN_INCORRECT_FOR_VALUE>: 114}}
Per CUI failure modes
{'DETECTED_ENTITY': {<FM.NAME_UNKNOWN>: 11645, <FM.NER_NO_SPAN>: 15751, <FM.SPAN_INCORRECT_FOR_VALUE>: 114}}
All failure modes
{<FM.NAME_UNKNOWN>: 11645, <FM.NER_NO_SPAN>: 15751, <FM.SPAN_INCORRECT_FOR_VALUE>: 114}

I think this is as good as we're going to be able to get with the NER-only use case. That's because of the nature of the NER-only step that assumes a perfect linker (that knows all the CUIs, and knows all their names).

@mart-r

mart-r commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator Author

I've now made a few changes:

  • Fixed a few issues with NER only and linker only runs
  • Avoided re-running the pipe (which also was the reason for linker-only run faiures)
    • Now reusing the original document

I've also reran the metrics and here's the results in total print mode:

  1. The entire pipe:
All failure modes
{<FM.BELOW_THRESHOLD>: 4464,
 <FM.CUI_NOT_IN_CDB>: 358,
 <FM.NAME_NOT_LINKED_TO_CUI>: 13934,
 <FM.NAME_UNKNOWN>: 12727,
 <FM.NER_NO_SPAN>: 76,
 <FM.SPAN_GOLD_CONTAINS_PRED>: 2,
 <FM.SPAN_INCORRECT_FOR_VALUE>: 129,
 <FM.SPAN_PARTIAL_OVERLAP>: 34,
 <FM.SPAN_PRED_CONTAINS_GOLD>: 47,
 <FM.WRONG_CONCEPT_ANCESTOR>: 36,
 <FM.WRONG_CONCEPT_DESCENDANT>: 31,
 <FM.WRONG_CONCEPT_DIRECT_CHILD>: 357,
 <FM.WRONG_CONCEPT_DIRECT_PARENT>: 106,
 <FM.WRONG_CONCEPT_SIBLING>: 24,
 <FM.WRONG_CONCEPT_UNRELATED>: 460}
  1. The NER only option
All failure modes
{<FM.BELOW_THRESHOLD>: 13855,
 <FM.NAME_UNKNOWN>: 11470,
 <FM.NER_NO_SPAN>: 851,
 <FM.SPAN_GOLD_CONTAINS_PRED>: 333,
 <FM.SPAN_INCORRECT_FOR_VALUE>: 114,
 <FM.SPAN_PARTIAL_OVERLAP>: 78,
 <FM.SPAN_PRED_CONTAINS_GOLD>: 810}
  1. The linker only option
All failure modes
{<FM.BELOW_THRESHOLD>: 24266,
 <FM.CUI_NOT_IN_CDB>: 358,
 <FM.NAME_NOT_LINKED_TO_CUI>: 13960,
 <FM.NAME_UNKNOWN>: 12797,
 <FM.NER_NO_SPAN>: 3,
 <FM.SPAN_INCORRECT_FOR_VALUE>: 190}

NOTE: The numbers have changed somewhat. This has to do with the fact that I now used the real pipe's output documents/entities/tokens rather than rerunning over context.

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.

2 participants