I'm trying to solve a 'negation-like' classification problem, where I need to classify whether a certain word within the context has negative or positive label.

For example, how to identify whether a keyword has been prescribed or only mentioned:

['Aspirin has been prescribed to a patients'] -> {[('key_word': 'aspirin', 'prescribed': TRUE)]}

['If symptoms continue, the patient should consider taking Omeprazol'] -> {[('key_word': 'omeprazol', 'prescribed': FALSE)]}

[‘The plan is for him to commence 25mg of Trazodone as soon as he gets better.’] -> {[('key_word': 'trazodone ', 'prescribed': FALSE)]}

['her current meds are: sertraline 200 mg and olanzapine 5 mg'] -> {[('key_word': 'sertraline', 'prescribed': TRUE), ('key_word': 'olanzapine', 'prescribed': TRUE)]}

['if she continues to be depressed, then she needs to be started on Risperidone'] -> {[('key_word': 'risperidone', 'prescribed': FALSE)]}

I have a training data set for this task, but it is not clear how to formulate the classification problem. It is similar to sentiment classification problem, but here instead of predicting a label of the entire sentence, I need to predict a label of a certain keyword based on the context.

Any ideas?

  • 1
    $\begingroup$ You could try 3-grams and 4-grams TFIDF and then a Multinomial Naive Bayes Classifier. Is the key_word a part of the label? $\endgroup$ – Danny Feb 11 '19 at 15:43
  • $\begingroup$ @Danny, thanks. No, I provide the key_word to specify where the algorithm should be looking at (it should attend to my key_word and make decision about it). $\endgroup$ – Arnold Klein Feb 11 '19 at 16:41
  • 1
    $\begingroup$ Just make sure you remove the stop words and stem the words as well. I am afraid I still don't understand how the key_word is used. But, this approach should give you good enough results to visualise clusters and then see how can you improve your approach. $\endgroup$ – Danny Feb 11 '19 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.