Skip to content

Qinxi Yu, Henry Che Final Project - #1804

Open
quincy-u wants to merge 1 commit into
sunlabuiuc:masterfrom
quincy-u:mednli-t5-nli
Open

quincy-u wants to merge 1 commit into
sunlabuiuc:masterfrom
quincy-u:mednli-t5-nli

Conversation

@quincy-u

@quincy-u quincy-u commented Dec 4, 2026

Copy link
Copy Markdown

For our CS 598 reproduction of Li et al. (2025), "Are Clinical T5 Models Better for Clinical Text?" (https://proceedings.mlr.press/v259/li25a.html).

Adds MedNLIDataset with a split that keeps the official train/dev/test parts, the MedNLIClassification task, and T5NLI, which fine-tunes T5 to write out the label word and can decode greedily or pick the most likely label. Also adds an example script with our ablations, docs pages, and small tests on made-up data.

For our CS 598 reproduction of Li et al. (2025), "Are Clinical T5 Models
Better for Clinical Text?" (https://proceedings.mlr.press/v259/li25a.html).

Adds MedNLIDataset with a split that keeps the official train/dev/test
parts, the MedNLIClassification task, and T5NLI, which fine-tunes T5 to
write out the label word and can decode greedily or pick the most likely
label. Also adds an example script with our ablations, docs pages, and
small tests on made-up data.
@solarsys solarsys added the status: automatic The PR will go through automatic review process. label Dec 4, 2026
@solarsys

solarsys commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the contribution. I've labeled it status: automatic. All files are inside docs/, examples/, pyhealth/ and tests/. The tests are in tests/core and use a tiny local tokenizer, the shared __init__.py files only gain registration lines, and no new dependencies are added.

I'll request the AI review once the build passes.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

Test Coverage

Warning

Tests failure; coverage may be incomplete.

Total: 89.39% (69037 / 77232 lines)

Modified file Coverage Lines
pyhealth/datasets/__init__.py 100.00% 99 / 99
pyhealth/datasets/mednli.py 97.30% 36 / 37
pyhealth/models/__init__.py 100.00% 141 / 141
pyhealth/models/t5_nli.py 74.67% 56 / 75
pyhealth/tasks/__init__.py 98.73% 155 / 157
pyhealth/tasks/mednli_classification.py 100.00% 10 / 10

Workflow run · e7e968e

@solarsys

solarsys commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

The build check fails in the five tests/core/test_t5_nli.py tests with TypeError: T5ForConditionalGeneration.forward() got an unexpected keyword argument 'token_type_ids'.

The generic PreTrainedTokenizerFast built in save_tiny_t5 returns token_type_ids, and T5NLI.forward passes the whole encoding through self.t5(**enc, labels=targets). T5 doesn't accept that key. Real T5 tokenizers don't return it, but passing only input_ids=enc["input_ids"], attention_mask=enc["attention_mask"] (here and anywhere else **enc reaches the T5 model) would make the model robust and fix the tests. Setting model_input_names=["input_ids", "attention_mask"] on the test tokenizer would also work.

Once the build passes, comment /review on a line by itself to request the AI review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: automatic The PR will go through automatic review process.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants