I am using a NER model to extract the treatment (ice, heat, or OTC) present in text, but the treatment has multiple contexts.
- Patient was advised to use ice packs for their knee at home [Treatment - Homecare]
- Patient was given ice packs at the clinic [Treatment - In clinic]
The NER model extracts ice pack as Treatment entity in all the above sentences, but how do I make it learn the context and further identify if the treatment is homecare suggestion or in-clinic. The context should be learned based on the surrounding words (proceeding and following both).
What techniques should I use for this use case? I don't want to use rule based techniques on top of NER, I have already used those but I was hoping to do this in a more sophisticated manner.
For the entity recognition, I am using a pre-trained biomedical NER (from Scispacy libaray) and added my custom entities to it using Entity Ruler.