2

I am using a NER model to extract the treatment (ice, heat, or OTC) present in text, but the treatment has multiple contexts.

  1. Patient was advised to use ice packs for their knee at home [Treatment - Homecare]
  2. 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.

1 Answer 1

0

I would recommend you treat this as a classification problem. Given sentences like your examples, train a classifier to predict a label like HOME/CLINIC/OTHER. It should be easy to label examples and you can use the spaCy textcat model.

One thing to be careful about is, do you know what the ratio of each label in your data should be roughly? If it's really unbalanced that could be an issue and you might need to alter your approach a bit.

You could also add an NER label for LOCATION, but I suspect it would be harder to label and not as good a match for your data.

Another approach, whose primary advantage is that it would be fast to test, would be to identify prepositional phrases like "at SOMEWHERE", or "in the SOMEWHERE". Using that you might find that just matching a phrase like "at home" labels a large portion of your dataset. I know you say you want to use something more sophisticated, but if the simple thing works, it's worth using.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.