I work with pharmaceutical label data. The text is always structured using the phrase “indicated for”.
For instance:
sentence = "Meloxicam tablet is indicated for relief of the signs and symptoms of osteoarthritis and rheumatoid arthritis"
I have already used SpaCy to filter only offers containing the phrase “indicated for”.
Now I need a function that will accept the sentence, and return a phrase that is the "specified for" object. So, for this example, the function I called extract() will work as follows:
extract(sentence) >> 'relief of the signs and symptoms of osteoarthritis and rheumatoid arthritis'
Is there a function for this using spacy?
EDIT: Simple splitting after “indicated for” will not work for complex examples.
Here are some examples:
'' 'buprenorphine and naloxone sublingual tablets are indicated for "strong" supportive treatment of opioid dependence and should be used as part of a complete treatment plan, including counseling and psychosocial support for buprenorphine and naloxone sublingual tablets containing buprenorphine - a partial opioid agonist and naloxone - opioid antagonist for the "supportive" treatment of opioid dependence ''
Ophthalmic solution ofloxacin ofloxacin
'' is indicated for the treatment of infections caused by susceptible strains of the following bacteria , under the conditions listed below, conjunctivitis of gram-positive bacteria, gram-negative bacteria, staphylococcus aureus staphylococcus epidermidis streptococcus pneumoniae enterobacter cloacae haemophilus influenzae proteus mirabilis pseudomonas aeruginosa aeruginosa aeruginosa pseudomonas aeruginosa serratia marcescens' ''
where I just need the bold parts.
source share