LLMs for Clinical NLP
The goal of this library is to consolidate, extend, and provide helpful wrappers around tools for training and evaluating decoder LLMs for clinical NLP.
Clone this repo and install using uv:
git clone https://github.com/Machine-Learning-for-Medical-Language/cnlp_llm.git
cd cnlp_llm
uv sync
source .venv/bin/activateA few useful development tools are provided via the Makefile.
To install pre-commit hooks, run make hooks.
To lint, format, and type check your code, run make check.
To run tests with pytest, run make test.
...
We use TRL for fine-tuning. Refer to the examples or run cnlp_llm finetune for more details.
To start an interactive chat session with a model, run cnlp_llm chat. See the examples for more info.
For evaluation, we use Inspect. For more details, see the examples or the Inspect documentation.
You can serve inference of an inspect Task on your local network with cnlp_llm serve. See the examples for more info.