CogStack / MedCATservice

Running MedCAT as a RESTful web service
17 stars 14 forks source link

CUI filter not working with model pack #27

Closed sandertan closed 1 year ago

sandertan commented 1 year ago

Hi @vladd-bit and @w-is-h . Currently, the APP_MODEL_CUI_FILTER_PATH parameter does not work with the model pack, because the cat object is returned before loading the CUI filter (https://github.com/CogStack/MedCATservice/blob/ea454a7ae04baeb5508962c256f889bf8dfb7667/medcat_service/nlp_processor/medcat_processor.py#L210) Is this a design choice, or missing functionality?

I'm trying to use a general MedCAT model (containing all CUIs) for a filtered entity linking project. My strategy was to use the full model to do NER+NEL, and at the end apply a filter to subset the returned CUIs. Is using the APP_MODEL_CUI_FILTER_PATH the correct way to do this? It depends on whether MedCAT applies the CUI Filter before or after NER+NEL, right? Or should I remove the filter, and do my own filtering on the MedCAT(service) results?

sandertan commented 1 year ago

I created a PR in case you want this functionality.

vladd-bit commented 1 year ago

Merged.