def LF_IS_BIOMARKER(c): """ This label function examines a sentences to determine of a sentence is talking about a biomarker. (A biomarker leads towards D-G assocation c - The candidate obejct being passed in """ return rule_regex_search_btw_AB(c, ltp(biomarker_indicators), 1) or rule_regex_search_btw_BA(c, ltp(biomarker_indicators), 1)
def LF_DdG_DOWNREGULATES(c): """ This label function is designed to search for words that indicate a sort of negative response or imply an downregulates association """ if LF_DG_METHOD_DESC(c) or LF_DG_TITLE(c): return 0 else: if rule_regex_search_btw_AB(c, r'.*'+ltp(downregulates)+r'.*', 1): return 1 elif rule_regex_search_btw_BA(c, r'.*'+ltp(downregulates)+r'.*', 1): return 1 elif re.search(r'({{A}}|{{B}}).*({{A}}|{{B}}).*' + ltp(downregulates), get_tagged_text(c)): return 1 else: return 0
def LF_DG_DIAGNOSIS(c): """ This label function is designed to search for words that imply a patient diagnosis which will provide evidence for possible disease gene association. """ return 1 if any([rule_regex_search_btw_AB(c, r'.*'+ltp(diagnosis_indicators) + r".*", 1), rule_regex_search_btw_BA(c, r'.*'+ltp(diagnosis_indicators) + r".*", 1)]) or \ re.search(r'({{A}}|{{B}}).*({{A}}|{{B}}).*' + ltp(diagnosis_indicators), get_tagged_text(c)) else 0
def LF_far_h_v(c): return rule_regex_search_btw_BA(c, '.{350,5000}', -1)
def LF_DG_NEGATIVE_DIRECTION(c): """ This label function is designed to search for words that indicate a sort of negative response or imply an downregulates association """ return 1 if any([rule_regex_search_btw_AB(c, r'.*'+ltp(negative_direction)+r'.*', 1), rule_regex_search_btw_BA(c, r'.*'+ltp(negative_direction)+r'.*', 1)]) or \ re.search(r'({{A}}|{{B}}).*({{A}}|{{B}}).*' + ltp(negative_direction), get_tagged_text(c)) else 0
def LF_is_a(c): """ If {{a}} is a {{B}} or {{B}} is a {{A}} """ return rule_regex_search_btw_AB( c, r'.* is a .*', -1) or rule_regex_search_btw_BA(c, r'is a', -1)