Machine-Learning-for-Medical-Language / cnlp_transformers

Transformers for Clinical NLP
https://cnlp-transformers.readthedocs.io/en/stable/
Apache License 2.0
21 stars 17 forks source link

REST APIs Support Loading Models on Disk #194

Open etgld opened 1 year ago

etgld commented 1 year ago

Might be collapsible into #158 but the use case I'm thinking of involves making PBJ annotators via REST classes for Jiarui's DTR and TLINK models. The issue is that for the DTR and temporal REST classes there isn't currently a direct way to initialize them from a cnlpt model on disk. temporal_rest.py comes the closest with trying to get the model name from the OS environment but:

  1. It's the only REST interface that currently does that at the moment.
  2. I'm not sure how the environment variable approach would gel with the Dockerized ctakes PBJ-based approach we have to use
etgld commented 1 year ago

Turns out for our use case we have models with both cnlp and Hf style configs. If I can get that working can fold the functionality that loads them both into this.