Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
2fa9f41
Add debug logging to context based linker if there are no link candid…
mart-r Oct 2, 2026
ff58c23
Some linting / whitespace fixes
mart-r Oct 2, 2026
038700f
Add debug logging to stats
mart-r Oct 2, 2026
d656a14
Some minor linting fixes
mart-r Oct 2, 2026
87cd5fc
Even more minor linting fixes
mart-r Oct 2, 2026
1dfe02e
Move some common stats parts to a separate module
mart-r Oct 2, 2026
ca62039
Add centralised pt2ch reversing method
mart-r Oct 5, 2026
5909d8d
Add initial failure mode code
mart-r Oct 5, 2026
8af9000
Use failure mode getting in stats (not fully propagated yet)
mart-r Oct 5, 2026
940b0e2
Propagate failure mode finding fully
mart-r Oct 5, 2026
81494af
Simplify step 1 in failure modes
mart-r Oct 5, 2026
b7736ac
Simplify failure mode logic
mart-r Oct 5, 2026
a097694
Moved some functions into class methods
mart-r Oct 5, 2026
5e23411
Remove some unused comments and data
mart-r Oct 5, 2026
fa86e1e
Fix leftover issue with function/method refactor
mart-r Oct 6, 2026
e8ba4e6
Add a few tests
mart-r Oct 6, 2026
580472b
Add new dummy mct for win some loose some
mart-r Oct 6, 2026
fb574e9
Add a few follow up tests for stats with failure modes
mart-r Oct 6, 2026
c6866b8
Minor linting fixes
mart-r Oct 6, 2026
8a22b0f
Add a bit of summarisation possibilities
mart-r Oct 6, 2026
c70a136
Add newline at end of module
mart-r Oct 6, 2026
d58d306
Add possibility of more details in summary
mart-r Oct 6, 2026
1a7d8cf
Fix overreporting of NER failures
mart-r Oct 6, 2026
ae2334c
Fix span candidates
mart-r Oct 6, 2026
68a55aa
Add some doc strings
mart-r Oct 6, 2026
8b9a49b
Protect all non-api methods
mart-r Oct 6, 2026
3c7ad3d
Minor typing fixes
mart-r Oct 6, 2026
c0a951a
Fix tests with changes to method names
mart-r Oct 6, 2026
ac3dca1
Fix minor linting issues
mart-r Oct 6, 2026
4e780fb
Add fallback to delegated component to dataset aware components
mart-r Oct 8, 2026
01e9da9
Fix minor typing issue in training utils
mart-r Oct 8, 2026
7fe9bcb
Move NER detected entity flag for ner-only stats to common module
mart-r Oct 8, 2026
eb3a9d0
Fix argument issue due to undone refactor
mart-r Oct 8, 2026
1bf5b8b
Add workaround for NER-only step failure modes
mart-r Oct 8, 2026
f7a4ee2
Avoid need to rerun the pipe a second time for failure modes
mart-r Oct 9, 2026
b54c658
Update tests to work with changed code
mart-r Oct 9, 2026
82468ff
Remove unused imports; fix minor linting issue
mart-r Oct 9, 2026
8a6000e
Remove debug output
mart-r Oct 9, 2026
d1e7f26
Some more work for NER-only failure modes
mart-r Oct 9, 2026
7bc2695
Use entire document instead of just local context for step 0 (sanity …
mart-r Oct 9, 2026
1bd3c3f
Update tests in line with recent changes
mart-r Oct 9, 2026
f613686
Remove excess debug output from tests
mart-r Oct 9, 2026
5f37965
Merge branch 'main' into feat/medcat/CPDT-223-add-failure-modes-to-ge…
mart-r Oct 9, 2026
68c8252
Fix issue that was incorrectly dealt with in prior merge
mart-r Oct 9, 2026
49ddd98
Fix type issue
mart-r Oct 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions medcat/medcat/components/linking/context_based_linker.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def _process_entity_inference(
# Check does it have a detected concepts
cuis = entity.link_candidates
if not cuis:
logger.debug("No candidates")
return
# Check does it have a detected name
name = entity.detected_name
Expand Down
37 changes: 37 additions & 0 deletions medcat/medcat/stats/common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from typing import TypedDict

from medcat.tokenizing.tokens import MutableEntity


NER_DETECTED_ENTITY_TAG = "DETECTED_ENTITY"


class GoldAnnotation(TypedDict):
"""Validated gold annotation payload after CUI filtering."""

start: int
end: int
cuis: list[str]
cui: str
text: str
raw: object
document_id: int
document_name: str
# context is 60 chars before + after the entity
context: str


class PredictedAnnotation(TypedDict):
"""Predicted entity payload used for scoring and metrics."""

start: int
end: int
cui: str
text: str
confidence: float
raw: MutableEntity
no_tokens: int
document_id: int
document_name: str
# context is 60 chars before + after the entity
context: str
Loading
Loading