disease_gene/disease_associates_gene/data/label_functions/disease_gene_lfs.py
def LF_DG_CHECK_GENE_TAG(c):
    """
    This label function is used for labeling each passed candidate as either pos or neg.
    Keyword Args:
    c- the candidate object to be passed in.
    """
    sen = c[1].get_parent()
    gene_name = re.sub("\)", "", c[1].get_span().lower())
    gene_id = sen.entity_cids[c[1].get_word_start()]
    gene_entry_df = gene_desc.query("GeneID == @gene_id")

    if gene_entry_df.empty:
        return -1

    for token in gene_name.split(" "):
        if gene_entry_df["Symbol"].values[0].lower() == token or token in gene_entry_df["Synonyms"].values[0].lower():
            return 0
        elif token in gene_entry_df["description"].values[0].lower():
            return 0
    return -1

    This label function is used for labeling each passed candidate as either pos or neg.
    Keyword Args:
    c- the candidate object to be passed in.
    
This label function is used for labeling each passed candidate as either pos or neg.
Keyword Args:
c- the candidate object to be passed in.
This label function is used for labeling each passed candidate as either pos or neg . Keyword Args : c - the candidate object to be passed in .
def LF_DG_CHECK_GENE_TAG(c):
    sen = c[1].get_parent()
    gene_name = re.sub("\)", "", c[1].get_span().lower())
    gene_id = sen.entity_cids[c[1].get_word_start()]
    gene_entry_df = gene_desc.query("GeneID == @gene_id")
    if gene_entry_df.empty:
        return -1
    for token in gene_name.split(" "):
        if gene_entry_df["Symbol"].values[0].lower() == token or token in gene_entry_df["Synonyms"].values[0].lower():
            return 0
        elif token in gene_entry_df["description"].values[0].lower():
            return 0
    return -1
def LF_DG_CHECK_GENE_TAG ( c ) : sen = c [ 1 ] . get_parent ( ) gene_name = re . sub ( "\)" , "" , c [ 1 ] . get_span ( ) . lower ( ) ) gene_id = sen . entity_cids [ c [ 1 ] . get_word_start ( ) ] gene_entry_df = gene_desc . query ( "GeneID == @gene_id" ) if gene_entry_df . empty : return - 1 for token in gene_name . split ( " " ) : if gene_entry_df [ "Symbol" ] . values [ 0 ] . lower ( ) == token or token in gene_entry_df [ "Synonyms" ] . values [ 0 ] . lower ( ) : return 0 elif token in gene_entry_df [ "description" ] . values [ 0 ] . lower ( ) : return 0 return - 1
This label function is used for labeling each passed candidate as either pos or neg.
This label function is used for labeling each passed candidate as either pos or neg .
"""
    This label function is used for labeling each passed candidate as either pos or neg.
    Keyword Args:
    c- the candidate object to be passed in.
    """
c