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.
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.