purplepotion / sadrat

Smart Adverse Drug Reaction Assessment Tools.
MIT License
17 stars 10 forks source link

Write a module to return "midfix" of a sentence. #20

Open ShaswatLenka opened 4 years ago

ShaswatLenka commented 4 years ago

Write a method-like (methods belong to a class) module getMidfix(*args) that takes a sentence and returns the midfix of the sentence. midfix is the part of the sentence that is between the prefix and the postfix. The prefix is always a drug name and the postfix is always an ADR, irrespective of where they appear in a sentence. You are provided with a dictionary of the following structure: _{drug_name : list(adr_1,adr_2,...adr_n)}_. with type: {str:list(str,str...,str)}. Note that the ADRs encountered in the tweets might not always be well defined in the ADR list already provided to you. You are required to find a solution that is able to successfully extract the midfix(or an equivalent sentence containing a midfix with least error) if such a situation arises.
All the modules go into the /modules directory.