Add event-free survival evaluation
This commit is contained in:
@@ -200,19 +200,7 @@ def _build_first_occurrence_maps(
|
||||
|
||||
|
||||
def _get_death_token_ids(dataset: HealthDataset) -> List[int]:
|
||||
ids: List[int] = []
|
||||
|
||||
exact_codes = {"death", "<death>", "dth", "deceased", "mortality"}
|
||||
for token, code in dataset.label_id_to_code.items():
|
||||
token = int(token)
|
||||
if token in SPECIAL_TOKENS:
|
||||
continue
|
||||
text = str(code).strip().lower()
|
||||
if text in exact_codes or ("death" in text) or ("mortality" in text):
|
||||
ids.append(token)
|
||||
|
||||
death_ids = sorted(set(int(x)
|
||||
for x in ids if int(x) not in SPECIAL_TOKENS))
|
||||
death_ids = [int(dataset.vocab_size) - 1]
|
||||
print(f"[INFO] death token ids: {death_ids}")
|
||||
return death_ids
|
||||
|
||||
|
||||
Reference in New Issue
Block a user