hexsha
stringlengths
40
40
repo
stringlengths
7
114
path
stringlengths
4
124
license
listlengths
1
9
language
stringclasses
1 value
identifier
stringlengths
1
71
return_type
stringlengths
1
749
original_string
stringlengths
76
22.7k
original_docstring
stringlengths
16
7.61k
docstring
stringlengths
16
2.47k
docstring_tokens
listlengths
6
477
code
stringlengths
14
10.2k
code_tokens
listlengths
6
996
short_docstring
stringlengths
2
644
short_docstring_tokens
listlengths
1
116
comment
listlengths
1
89
parameters
listlengths
0
64
docstring_params
dict
34ffd5b620f09d787deb594a055410486a7745d2
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_NO_CONCLUSION
<not_specific>
def LF_DG_NO_CONCLUSION(c): """ This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association. """ po...
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association.
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association.
[ "This", "label", "function", "fires", "a", "-", "1", "if", "the", "number", "of", "negative", "label", "functinos", "is", "greater", "than", "the", "number", "of", "positive", "label", "functions", ".", "The", "main", "idea", "behind", "this", "label", "fu...
def LF_DG_NO_CONCLUSION(c): positive_num = np.sum([LF_DG_ASSOCIATION(c), LF_DG_IS_BIOMARKER(c),LF_DG_NO_ASSOCIATION(c), LF_DG_POSITIVE_DIRECTION(c), LF_DG_NEGATIVE_DIRECTION(c), LF_DG_DIAGNOSIS(c), np.abs(LF_DG_WEAK_ASSOCIATION(c)), np.abs(LF_DG_NO_ASSOCIATION(c))]) negative_num = np.a...
[ "def", "LF_DG_NO_CONCLUSION", "(", "c", ")", ":", "positive_num", "=", "np", ".", "sum", "(", "[", "LF_DG_ASSOCIATION", "(", "c", ")", ",", "LF_DG_IS_BIOMARKER", "(", "c", ")", ",", "LF_DG_NO_ASSOCIATION", "(", "c", ")", ",", "LF_DG_POSITIVE_DIRECTION", "(",...
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions.
[ "This", "label", "function", "fires", "a", "-", "1", "if", "the", "number", "of", "negative", "label", "functinos", "is", "greater", "than", "the", "number", "of", "positive", "label", "functions", "." ]
[ "\"\"\"\n This label function fires a -1 if the number of negative label functinos is greater than the number\n of positive label functions.\n The main idea behind this label function is add support to sentences that could\n mention a possible disease gene association.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
34ffd5b620f09d787deb594a055410486a7745d2
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_CONCLUSION
<not_specific>
def LF_DG_CONCLUSION(c): """ This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association """ if LF_D...
This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association
This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association
[ "This", "label", "function", "fires", "a", "1", "if", "the", "number", "of", "positive", "label", "functions", "is", "greater", "than", "the", "number", "of", "negative", "label", "functions", ".", "The", "main", "idea", "behind", "this", "label", "function"...
def LF_DG_CONCLUSION(c): if LF_DG_NO_ASSOCIATION(c) or LF_DG_WEAK_ASSOCIATION(c): return -1 elif not LF_DG_NO_CONCLUSION(c): return 1 else: return 0
[ "def", "LF_DG_CONCLUSION", "(", "c", ")", ":", "if", "LF_DG_NO_ASSOCIATION", "(", "c", ")", "or", "LF_DG_WEAK_ASSOCIATION", "(", "c", ")", ":", "return", "-", "1", "elif", "not", "LF_DG_NO_CONCLUSION", "(", "c", ")", ":", "return", "1", "else", ":", "ret...
This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions.
[ "This", "label", "function", "fires", "a", "1", "if", "the", "number", "of", "positive", "label", "functions", "is", "greater", "than", "the", "number", "of", "negative", "label", "functions", "." ]
[ "\"\"\"\n This label function fires a 1 if the number of positive label functions is greater than the number\n of negative label functions.\n The main idea behind this label function is add support to sentences that could\n mention a possible disease gene association\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
34ffd5b620f09d787deb594a055410486a7745d2
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_DISTANCE_LONG
<not_specific>
def LF_DG_DISTANCE_LONG(c): """ This LF is designed to make sure that the disease mention and the gene mention aren't too far from each other. """ return -1 if len(list(get_between_tokens(c))) > 25 else 0
This LF is designed to make sure that the disease mention and the gene mention aren't too far from each other.
This LF is designed to make sure that the disease mention and the gene mention aren't too far from each other.
[ "This", "LF", "is", "designed", "to", "make", "sure", "that", "the", "disease", "mention", "and", "the", "gene", "mention", "aren", "'", "t", "too", "far", "from", "each", "other", "." ]
def LF_DG_DISTANCE_LONG(c): return -1 if len(list(get_between_tokens(c))) > 25 else 0
[ "def", "LF_DG_DISTANCE_LONG", "(", "c", ")", ":", "return", "-", "1", "if", "len", "(", "list", "(", "get_between_tokens", "(", "c", ")", ")", ")", ">", "25", "else", "0" ]
This LF is designed to make sure that the disease mention and the gene mention aren't too far from each other.
[ "This", "LF", "is", "designed", "to", "make", "sure", "that", "the", "disease", "mention", "and", "the", "gene", "mention", "aren", "'", "t", "too", "far", "from", "each", "other", "." ]
[ "\"\"\"\n This LF is designed to make sure that the disease mention\n and the gene mention aren't too far from each other.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
34ffd5b620f09d787deb594a055410486a7745d2
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_ALLOWED_DISTANCE
<not_specific>
def LF_DG_ALLOWED_DISTANCE(c): """ This LF is designed to make sure that the disease mention and the gene mention are in an acceptable distance between each other """ return 0 if any([ LF_DG_DISTANCE_LONG(c), LF_DG_DISTANCE_SHORT(c) ]) else 1 if random.random() < 0.65 el...
This LF is designed to make sure that the disease mention and the gene mention are in an acceptable distance between each other
This LF is designed to make sure that the disease mention and the gene mention are in an acceptable distance between each other
[ "This", "LF", "is", "designed", "to", "make", "sure", "that", "the", "disease", "mention", "and", "the", "gene", "mention", "are", "in", "an", "acceptable", "distance", "between", "each", "other" ]
def LF_DG_ALLOWED_DISTANCE(c): return 0 if any([ LF_DG_DISTANCE_LONG(c), LF_DG_DISTANCE_SHORT(c) ]) else 1 if random.random() < 0.65 else 0
[ "def", "LF_DG_ALLOWED_DISTANCE", "(", "c", ")", ":", "return", "0", "if", "any", "(", "[", "LF_DG_DISTANCE_LONG", "(", "c", ")", ",", "LF_DG_DISTANCE_SHORT", "(", "c", ")", "]", ")", "else", "1", "if", "random", ".", "random", "(", ")", "<", "0.65", ...
This LF is designed to make sure that the disease mention and the gene mention are in an acceptable distance between each other
[ "This", "LF", "is", "designed", "to", "make", "sure", "that", "the", "disease", "mention", "and", "the", "gene", "mention", "are", "in", "an", "acceptable", "distance", "between", "each", "other" ]
[ "\"\"\"\n This LF is designed to make sure that the disease mention\n and the gene mention are in an acceptable distance between \n each other\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
34ffd5b620f09d787deb594a055410486a7745d2
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_NO_VERB
<not_specific>
def LF_DG_NO_VERB(c): """ This label function is designed to fire if a given sentence doesn't contain a verb. Helps cut out some of the titles hidden in Pubtator abstracts """ if len([x for x in nltk.pos_tag(word_tokenize(c.get_parent().text)) if "VB" in x[1]]) == 0: if "correlates with...
This label function is designed to fire if a given sentence doesn't contain a verb. Helps cut out some of the titles hidden in Pubtator abstracts
This label function is designed to fire if a given sentence doesn't contain a verb. Helps cut out some of the titles hidden in Pubtator abstracts
[ "This", "label", "function", "is", "designed", "to", "fire", "if", "a", "given", "sentence", "doesn", "'", "t", "contain", "a", "verb", ".", "Helps", "cut", "out", "some", "of", "the", "titles", "hidden", "in", "Pubtator", "abstracts" ]
def LF_DG_NO_VERB(c): if len([x for x in nltk.pos_tag(word_tokenize(c.get_parent().text)) if "VB" in x[1]]) == 0: if "correlates with" in c.get_parent().text: return 0 return -1 return 0
[ "def", "LF_DG_NO_VERB", "(", "c", ")", ":", "if", "len", "(", "[", "x", "for", "x", "in", "nltk", ".", "pos_tag", "(", "word_tokenize", "(", "c", ".", "get_parent", "(", ")", ".", "text", ")", ")", "if", "\"VB\"", "in", "x", "[", "1", "]", "]",...
This label function is designed to fire if a given sentence doesn't contain a verb.
[ "This", "label", "function", "is", "designed", "to", "fire", "if", "a", "given", "sentence", "doesn", "'", "t", "contain", "a", "verb", "." ]
[ "\"\"\"\n This label function is designed to fire if a given\n sentence doesn't contain a verb. Helps cut out some of the titles\n hidden in Pubtator abstracts\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
34ffd5b620f09d787deb594a055410486a7745d2
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_BICLUSTER_CASUAL_MUTATIONS
<not_specific>
def LF_DG_BICLUSTER_CASUAL_MUTATIONS(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_DG_BICLUSTER_CASUAL_MUTATIONS(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["U"].sum() > 0.0: return 1 return 0
[ "def", "LF_DG_BICLUSTER_CASUAL_MUTATIONS", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "quer...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
34ffd5b620f09d787deb594a055410486a7745d2
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_BICLUSTER_MUTATIONS
<not_specific>
def LF_DG_BICLUSTER_MUTATIONS(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@s...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_DG_BICLUSTER_MUTATIONS(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["Ud"].sum() > 0.0: return 1 return 0
[ "def", "LF_DG_BICLUSTER_MUTATIONS", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query", "...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
34ffd5b620f09d787deb594a055410486a7745d2
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_BICLUSTER_DRUG_TARGETS
<not_specific>
def LF_DG_BICLUSTER_DRUG_TARGETS(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num=...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_DG_BICLUSTER_DRUG_TARGETS(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["D"].sum() > 0.0: return 1 return 0
[ "def", "LF_DG_BICLUSTER_DRUG_TARGETS", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query", ...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
34ffd5b620f09d787deb594a055410486a7745d2
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_BICLUSTER_PATHOGENESIS
<not_specific>
def LF_DG_BICLUSTER_PATHOGENESIS(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num=...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_DG_BICLUSTER_PATHOGENESIS(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["J"].sum() > 0.0: return 1 return 0
[ "def", "LF_DG_BICLUSTER_PATHOGENESIS", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query", ...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
34ffd5b620f09d787deb594a055410486a7745d2
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_BICLUSTER_THERAPEUTIC
<not_specific>
def LF_DG_BICLUSTER_THERAPEUTIC(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_DG_BICLUSTER_THERAPEUTIC(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["Te"].sum() > 0.0: return 1 return 0
[ "def", "LF_DG_BICLUSTER_THERAPEUTIC", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query", ...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
34ffd5b620f09d787deb594a055410486a7745d2
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_BICLUSTER_POLYMORPHISMS
<not_specific>
def LF_DG_BICLUSTER_POLYMORPHISMS(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_DG_BICLUSTER_POLYMORPHISMS(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["Y"].sum() > 0.0: return 1 return 0
[ "def", "LF_DG_BICLUSTER_POLYMORPHISMS", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query",...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
34ffd5b620f09d787deb594a055410486a7745d2
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_BICLUSTER_PROGRESSION
<not_specific>
def LF_DG_BICLUSTER_PROGRESSION(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_DG_BICLUSTER_PROGRESSION(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["G"].sum() > 0.0: return 1 return 0
[ "def", "LF_DG_BICLUSTER_PROGRESSION", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query", ...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
34ffd5b620f09d787deb594a055410486a7745d2
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_BICLUSTER_BIOMARKERS
<not_specific>
def LF_DG_BICLUSTER_BIOMARKERS(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_DG_BICLUSTER_BIOMARKERS(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["Md"].sum() > 0.0: return 1 return 0
[ "def", "LF_DG_BICLUSTER_BIOMARKERS", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query", ...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
34ffd5b620f09d787deb594a055410486a7745d2
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_BICLUSTER_OVEREXPRESSION
<not_specific>
def LF_DG_BICLUSTER_OVEREXPRESSION(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_nu...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_DG_BICLUSTER_OVEREXPRESSION(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["X"].sum() > 0.0: return 1 return 0
[ "def", "LF_DG_BICLUSTER_OVEREXPRESSION", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query"...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
34ffd5b620f09d787deb594a055410486a7745d2
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_BICLUSTER_REGULATION
<not_specific>
def LF_DG_BICLUSTER_REGULATION(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_DG_BICLUSTER_REGULATION(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["L"].sum() > 0.0: return 1 return 0
[ "def", "LF_DG_BICLUSTER_REGULATION", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query", ...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
8bd14d5184d76c121d56e0234cc1e3799c63685f
ajlee21/snorkeling
create_database/database_insertion.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
offsets_to_token
<not_specific>
def offsets_to_token(left, right, offset_array, lemmas, punc=set(punctuation)): """Calculate the offset from tag to token Ripped off from the snorkel custom tagger. Designed to get the offset where a given token is found so it can receive a custom entity tag. (i.e. Gene or Chemical) Keyword argument...
Calculate the offset from tag to token Ripped off from the snorkel custom tagger. Designed to get the offset where a given token is found so it can receive a custom entity tag. (i.e. Gene or Chemical) Keyword arguments left - the start of the tag right - the end of the tag offset_array - arr...
Calculate the offset from tag to token Ripped off from the snorkel custom tagger. Designed to get the offset where a given token is found so it can receive a custom entity tag.
[ "Calculate", "the", "offset", "from", "tag", "to", "token", "Ripped", "off", "from", "the", "snorkel", "custom", "tagger", ".", "Designed", "to", "get", "the", "offset", "where", "a", "given", "token", "is", "found", "so", "it", "can", "receive", "a", "c...
def offsets_to_token(left, right, offset_array, lemmas, punc=set(punctuation)): token_start, token_end = None, None for i, c in enumerate(offset_array): if left >= c: token_start = i if c > right and token_end is None: token_end = i break token_end = len(o...
[ "def", "offsets_to_token", "(", "left", ",", "right", ",", "offset_array", ",", "lemmas", ",", "punc", "=", "set", "(", "punctuation", ")", ")", ":", "token_start", ",", "token_end", "=", "None", ",", "None", "for", "i", ",", "c", "in", "enumerate", "(...
Calculate the offset from tag to token Ripped off from the snorkel custom tagger.
[ "Calculate", "the", "offset", "from", "tag", "to", "token", "Ripped", "off", "from", "the", "snorkel", "custom", "tagger", "." ]
[ "\"\"\"Calculate the offset from tag to token\n Ripped off from the snorkel custom tagger.\n Designed to get the offset where a given token is found so it can receive a custom entity tag.\n (i.e. Gene or Chemical)\n Keyword arguments\n left - the start of the tag\n right - the end of the tag\n ...
[ { "param": "left", "type": null }, { "param": "right", "type": null }, { "param": "offset_array", "type": null }, { "param": "lemmas", "type": null }, { "param": "punc", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "left", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "right", "type": null, "docstring": null, "docstring_tokens": ...
8bd14d5184d76c121d56e0234cc1e3799c63685f
ajlee21/snorkeling
create_database/database_insertion.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
tag
<not_specific>
def tag(self, parts): """Tag each Sentence Keyword arguments: self -- the class object parts -- standford's corenlp object which consists of nlp properties Returns: An updated parts object containing specified custom tags. """ pubmed_id, _, _, sent_start,...
Tag each Sentence Keyword arguments: self -- the class object parts -- standford's corenlp object which consists of nlp properties Returns: An updated parts object containing specified custom tags.
Tag each Sentence Keyword arguments: self -- the class object parts -- standford's corenlp object which consists of nlp properties
[ "Tag", "each", "Sentence", "Keyword", "arguments", ":", "self", "--", "the", "class", "object", "parts", "--", "standford", "'", "s", "corenlp", "object", "which", "consists", "of", "nlp", "properties" ]
def tag(self, parts): pubmed_id, _, _, sent_start, sent_end = parts['stable_id'].split(':') sent_start, sent_end = int(sent_start), int(sent_end) try: for index, tag in self.annt_df.get_group(int(pubmed_id)).iterrows(): if not (sent_start <= int(tag['offset']) <= sent...
[ "def", "tag", "(", "self", ",", "parts", ")", ":", "pubmed_id", ",", "_", ",", "_", ",", "sent_start", ",", "sent_end", "=", "parts", "[", "'stable_id'", "]", ".", "split", "(", "':'", ")", "sent_start", ",", "sent_end", "=", "int", "(", "sent_start"...
Tag each Sentence Keyword arguments: self -- the class object parts -- standford's corenlp object which consists of nlp properties
[ "Tag", "each", "Sentence", "Keyword", "arguments", ":", "self", "--", "the", "class", "object", "parts", "--", "standford", "'", "s", "corenlp", "object", "which", "consists", "of", "nlp", "properties" ]
[ "\"\"\"Tag each Sentence\n Keyword arguments:\n self -- the class object\n parts -- standford's corenlp object which consists of nlp properties\n Returns:\n An updated parts object containing specified custom tags.\n \"\"\"", "# For each tag in the given document", "# a...
[ { "param": "self", "type": null }, { "param": "parts", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
8bd14d5184d76c121d56e0234cc1e3799c63685f
ajlee21/snorkeling
create_database/database_insertion.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
parse_file
null
def parse_file(self, f, file_name): """This method overrides the original method Keyword arguments: f - the file object to be parsed by lxml file_name - the name of the file used as metadata Yields: A document object in sqlalchemy format and the corresponding text ...
This method overrides the original method Keyword arguments: f - the file object to be parsed by lxml file_name - the name of the file used as metadata Yields: A document object in sqlalchemy format and the corresponding text that will be parsed by CoreNLP
This method overrides the original method Keyword arguments: f - the file object to be parsed by lxml file_name - the name of the file used as metadata
[ "This", "method", "overrides", "the", "original", "method", "Keyword", "arguments", ":", "f", "-", "the", "file", "object", "to", "be", "parsed", "by", "lxml", "file_name", "-", "the", "name", "of", "the", "file", "used", "as", "metadata" ]
def parse_file(self, f, file_name): for event, doc in et.iterparse(f, tag='document'): doc_id = str(doc.xpath(self.id)[0]) if int(doc_id) not in self.tag_filter: doc.clear() continue text = '\n'.join(filter(lambda t: t is not None, doc.xpath(se...
[ "def", "parse_file", "(", "self", ",", "f", ",", "file_name", ")", ":", "for", "event", ",", "doc", "in", "et", ".", "iterparse", "(", "f", ",", "tag", "=", "'document'", ")", ":", "doc_id", "=", "str", "(", "doc", ".", "xpath", "(", "self", ".",...
This method overrides the original method Keyword arguments: f - the file object to be parsed by lxml file_name - the name of the file used as metadata
[ "This", "method", "overrides", "the", "original", "method", "Keyword", "arguments", ":", "f", "-", "the", "file", "object", "to", "be", "parsed", "by", "lxml", "file_name", "-", "the", "name", "of", "the", "file", "used", "as", "metadata" ]
[ "\"\"\"This method overrides the original method\n Keyword arguments:\n f - the file object to be parsed by lxml\n file_name - the name of the file used as metadata\n Yields:\n A document object in sqlalchemy format and the corresponding text\n that will be parsed by CoreNL...
[ { "param": "self", "type": null }, { "param": "f", "type": null }, { "param": "file_name", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
8bd14d5184d76c121d56e0234cc1e3799c63685f
ajlee21/snorkeling
create_database/database_insertion.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
_can_read
<not_specific>
def _can_read(self, fpath): """ Straight forward function Keyword Arguments: fpath - the absolute path of the file. """ return fpath.endswith('.xml')
Straight forward function Keyword Arguments: fpath - the absolute path of the file.
Straight forward function Keyword Arguments: fpath - the absolute path of the file.
[ "Straight", "forward", "function", "Keyword", "Arguments", ":", "fpath", "-", "the", "absolute", "path", "of", "the", "file", "." ]
def _can_read(self, fpath): return fpath.endswith('.xml')
[ "def", "_can_read", "(", "self", ",", "fpath", ")", ":", "return", "fpath", ".", "endswith", "(", "'.xml'", ")" ]
Straight forward function Keyword Arguments: fpath - the absolute path of the file.
[ "Straight", "forward", "function", "Keyword", "Arguments", ":", "fpath", "-", "the", "absolute", "path", "of", "the", "file", "." ]
[ "\"\"\" Straight forward function\n Keyword Arguments:\n fpath - the absolute path of the file.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "fpath", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "fpath", "type": null, "docstring": null, "docstring_tokens": ...
7f1be78607f6994d08587d0d3906da18f5c37acb
ajlee21/snorkeling
playground/epilepsy/scripts/2.epilepsy-labeler.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_variation
<not_specific>
def LF_variation(c): """ If variation keyword in close proximity then label as positive """ if len(variation_words.intersection(get_left_tokens(c[1]))) > 0: return 1 if len(variation_words.intersection(get_right_tokens(c[1]))) > 0: return 1 return 0
If variation keyword in close proximity then label as positive
If variation keyword in close proximity then label as positive
[ "If", "variation", "keyword", "in", "close", "proximity", "then", "label", "as", "positive" ]
def LF_variation(c): if len(variation_words.intersection(get_left_tokens(c[1]))) > 0: return 1 if len(variation_words.intersection(get_right_tokens(c[1]))) > 0: return 1 return 0
[ "def", "LF_variation", "(", "c", ")", ":", "if", "len", "(", "variation_words", ".", "intersection", "(", "get_left_tokens", "(", "c", "[", "1", "]", ")", ")", ")", ">", "0", ":", "return", "1", "if", "len", "(", "variation_words", ".", "intersection",...
If variation keyword in close proximity then label as positive
[ "If", "variation", "keyword", "in", "close", "proximity", "then", "label", "as", "positive" ]
[ "\"\"\"\n If variation keyword in close proximity then label as positive\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7f1be78607f6994d08587d0d3906da18f5c37acb
ajlee21/snorkeling
playground/epilepsy/scripts/2.epilepsy-labeler.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_model_organisms
<not_specific>
def LF_model_organisms(c): """ If mentions model organism then c[1] should be a gene """ if len(model_organisms.intersection(get_left_tokens(c[1]))) > 0: return 1 if len(model_organisms.intersection(get_left_tokens(c[1]))) > 0: return 1 return 0
If mentions model organism then c[1] should be a gene
If mentions model organism then c[1] should be a gene
[ "If", "mentions", "model", "organism", "then", "c", "[", "1", "]", "should", "be", "a", "gene" ]
def LF_model_organisms(c): if len(model_organisms.intersection(get_left_tokens(c[1]))) > 0: return 1 if len(model_organisms.intersection(get_left_tokens(c[1]))) > 0: return 1 return 0
[ "def", "LF_model_organisms", "(", "c", ")", ":", "if", "len", "(", "model_organisms", ".", "intersection", "(", "get_left_tokens", "(", "c", "[", "1", "]", ")", ")", ")", ">", "0", ":", "return", "1", "if", "len", "(", "model_organisms", ".", "intersec...
If mentions model organism then c[1] should be a gene
[ "If", "mentions", "model", "organism", "then", "c", "[", "1", "]", "should", "be", "a", "gene" ]
[ "\"\"\"\n If mentions model organism then c[1] should be a gene\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7f1be78607f6994d08587d0d3906da18f5c37acb
ajlee21/snorkeling
playground/epilepsy/scripts/2.epilepsy-labeler.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_cause
<not_specific>
def LF_cause(c): """ If the causual keywords are between disease and gene then should be positive predictor """ if len(cause_words.intersection(get_between_tokens(c))) > 0: return 1 return 0
If the causual keywords are between disease and gene then should be positive predictor
If the causual keywords are between disease and gene then should be positive predictor
[ "If", "the", "causual", "keywords", "are", "between", "disease", "and", "gene", "then", "should", "be", "positive", "predictor" ]
def LF_cause(c): if len(cause_words.intersection(get_between_tokens(c))) > 0: return 1 return 0
[ "def", "LF_cause", "(", "c", ")", ":", "if", "len", "(", "cause_words", ".", "intersection", "(", "get_between_tokens", "(", "c", ")", ")", ")", ">", "0", ":", "return", "1", "return", "0" ]
If the causual keywords are between disease and gene then should be positive predictor
[ "If", "the", "causual", "keywords", "are", "between", "disease", "and", "gene", "then", "should", "be", "positive", "predictor" ]
[ "\"\"\"\n If the causual keywords are between disease and gene then should be positive predictor\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7f1be78607f6994d08587d0d3906da18f5c37acb
ajlee21/snorkeling
playground/epilepsy/scripts/2.epilepsy-labeler.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_neg_words
<not_specific>
def LF_neg_words(c): """ If it mentions serum or intervention before or after gene then negative """ if len(neg_words.intersection(get_left_tokens(c[1],window=3))) > 0: return -1 if len(neg_words.intersection(get_right_tokens(c[1],window=3))) > 0: return -1 return 0
If it mentions serum or intervention before or after gene then negative
If it mentions serum or intervention before or after gene then negative
[ "If", "it", "mentions", "serum", "or", "intervention", "before", "or", "after", "gene", "then", "negative" ]
def LF_neg_words(c): if len(neg_words.intersection(get_left_tokens(c[1],window=3))) > 0: return -1 if len(neg_words.intersection(get_right_tokens(c[1],window=3))) > 0: return -1 return 0
[ "def", "LF_neg_words", "(", "c", ")", ":", "if", "len", "(", "neg_words", ".", "intersection", "(", "get_left_tokens", "(", "c", "[", "1", "]", ",", "window", "=", "3", ")", ")", ")", ">", "0", ":", "return", "-", "1", "if", "len", "(", "neg_word...
If it mentions serum or intervention before or after gene then negative
[ "If", "it", "mentions", "serum", "or", "intervention", "before", "or", "after", "gene", "then", "negative" ]
[ "\"\"\"\n If it mentions serum or intervention before or after gene then negative \n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7f1be78607f6994d08587d0d3906da18f5c37acb
ajlee21/snorkeling
playground/epilepsy/scripts/2.epilepsy-labeler.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_gene
<not_specific>
def LF_gene(c): """ If candidate has gene word near it """ if "gene" in get_left_tokens(c[1]) or "gene" in get_right_tokens(c[1]): return 1 return 0
If candidate has gene word near it
If candidate has gene word near it
[ "If", "candidate", "has", "gene", "word", "near", "it" ]
def LF_gene(c): if "gene" in get_left_tokens(c[1]) or "gene" in get_right_tokens(c[1]): return 1 return 0
[ "def", "LF_gene", "(", "c", ")", ":", "if", "\"gene\"", "in", "get_left_tokens", "(", "c", "[", "1", "]", ")", "or", "\"gene\"", "in", "get_right_tokens", "(", "c", "[", "1", "]", ")", ":", "return", "1", "return", "0" ]
If candidate has gene word near it
[ "If", "candidate", "has", "gene", "word", "near", "it" ]
[ "\"\"\"\n If candidate has gene word near it\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7f1be78607f6994d08587d0d3906da18f5c37acb
ajlee21/snorkeling
playground/epilepsy/scripts/2.epilepsy-labeler.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_unrelated_disease
<not_specific>
def LF_unrelated_disease(c): """ If the disease is completely unrelated remove """ if c[0].get_span() in unrelated_diseases: return -1 return 0
If the disease is completely unrelated remove
If the disease is completely unrelated remove
[ "If", "the", "disease", "is", "completely", "unrelated", "remove" ]
def LF_unrelated_disease(c): if c[0].get_span() in unrelated_diseases: return -1 return 0
[ "def", "LF_unrelated_disease", "(", "c", ")", ":", "if", "c", "[", "0", "]", ".", "get_span", "(", ")", "in", "unrelated_diseases", ":", "return", "-", "1", "return", "0" ]
If the disease is completely unrelated remove
[ "If", "the", "disease", "is", "completely", "unrelated", "remove" ]
[ "\"\"\"\n If the disease is completely unrelated remove\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7f1be78607f6994d08587d0d3906da18f5c37acb
ajlee21/snorkeling
playground/epilepsy/scripts/2.epilepsy-labeler.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_related_adj
<not_specific>
def LF_related_adj(c): """ If there is a GENE with a -related tag next to it, then it might be important. """ for adj in gene_adj: if adj in c[1].get_span().lower(): return 1 return 0
If there is a GENE with a -related tag next to it, then it might be important.
If there is a GENE with a -related tag next to it, then it might be important.
[ "If", "there", "is", "a", "GENE", "with", "a", "-", "related", "tag", "next", "to", "it", "then", "it", "might", "be", "important", "." ]
def LF_related_adj(c): for adj in gene_adj: if adj in c[1].get_span().lower(): return 1 return 0
[ "def", "LF_related_adj", "(", "c", ")", ":", "for", "adj", "in", "gene_adj", ":", "if", "adj", "in", "c", "[", "1", "]", ".", "get_span", "(", ")", ".", "lower", "(", ")", ":", "return", "1", "return", "0" ]
If there is a GENE with a -related tag next to it, then it might be important.
[ "If", "there", "is", "a", "GENE", "with", "a", "-", "related", "tag", "next", "to", "it", "then", "it", "might", "be", "important", "." ]
[ "\"\"\"\n If there is a GENE with a -related tag next to it, then it might be important.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7f1be78607f6994d08587d0d3906da18f5c37acb
ajlee21/snorkeling
playground/epilepsy/scripts/2.epilepsy-labeler.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_disease_context
<not_specific>
def LF_disease_context(c): """ If mentions cases of or patients with -> disease """ tokens = "".join(get_left_tokens(c[1],window=3)) for context in disease_context: if context in tokens: return -1 return 0
If mentions cases of or patients with -> disease
If mentions cases of or patients with -> disease
[ "If", "mentions", "cases", "of", "or", "patients", "with", "-", ">", "disease" ]
def LF_disease_context(c): tokens = "".join(get_left_tokens(c[1],window=3)) for context in disease_context: if context in tokens: return -1 return 0
[ "def", "LF_disease_context", "(", "c", ")", ":", "tokens", "=", "\"\"", ".", "join", "(", "get_left_tokens", "(", "c", "[", "1", "]", ",", "window", "=", "3", ")", ")", "for", "context", "in", "disease_context", ":", "if", "context", "in", "tokens", ...
If mentions cases of or patients with -> disease
[ "If", "mentions", "cases", "of", "or", "patients", "with", "-", ">", "disease" ]
[ "\"\"\"\n If mentions cases of or patients with -> disease\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7f1be78607f6994d08587d0d3906da18f5c37acb
ajlee21/snorkeling
playground/epilepsy/scripts/2.epilepsy-labeler.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_is_gene
<not_specific>
def LF_is_gene(c): """ If the name is a gene """ if c[1].get_span() in set(gene_list["gene_name"]) or c[1].get_span() in set(gene_list["gene_symbol"]): return 0 return -1
If the name is a gene
If the name is a gene
[ "If", "the", "name", "is", "a", "gene" ]
def LF_is_gene(c): if c[1].get_span() in set(gene_list["gene_name"]) or c[1].get_span() in set(gene_list["gene_symbol"]): return 0 return -1
[ "def", "LF_is_gene", "(", "c", ")", ":", "if", "c", "[", "1", "]", ".", "get_span", "(", ")", "in", "set", "(", "gene_list", "[", "\"gene_name\"", "]", ")", "or", "c", "[", "1", "]", ".", "get_span", "(", ")", "in", "set", "(", "gene_list", "["...
If the name is a gene
[ "If", "the", "name", "is", "a", "gene" ]
[ "\"\"\"\n If the name is a gene\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
b948b6ddb6bec4c6c36614a2966cb603ff448827
ajlee21/snorkeling
modules/utils/notebook_utils/label_matrix_helper.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
label_candidates_db
<not_specific>
def label_candidates_db(labeler, cids_query, label_functions, apply_existing=False): """ This function is designed to label candidates and place the annotations inside a database. Will be rarely used since snorkel metal doesn't use a database for annotations. Important to keep if I were to go back towar...
This function is designed to label candidates and place the annotations inside a database. Will be rarely used since snorkel metal doesn't use a database for annotations. Important to keep if I were to go back towards snorkel's original database version labeler - the labeler object cids_query - th...
This function is designed to label candidates and place the annotations inside a database. Will be rarely used since snorkel metal doesn't use a database for annotations. Important to keep if I were to go back towards snorkel's original database version the labeler object cids_query - the query make for extracting can...
[ "This", "function", "is", "designed", "to", "label", "candidates", "and", "place", "the", "annotations", "inside", "a", "database", ".", "Will", "be", "rarely", "used", "since", "snorkel", "metal", "doesn", "'", "t", "use", "a", "database", "for", "annotatio...
def label_candidates_db(labeler, cids_query, label_functions, apply_existing=False): if apply_existing: return labeler.apply_existing(cids_query=cids_query, parllelistm=5, clear=False) else: return labeler.apply(cids_query=cids_query, parallelism=5)
[ "def", "label_candidates_db", "(", "labeler", ",", "cids_query", ",", "label_functions", ",", "apply_existing", "=", "False", ")", ":", "if", "apply_existing", ":", "return", "labeler", ".", "apply_existing", "(", "cids_query", "=", "cids_query", ",", "parllelistm...
This function is designed to label candidates and place the annotations inside a database.
[ "This", "function", "is", "designed", "to", "label", "candidates", "and", "place", "the", "annotations", "inside", "a", "database", "." ]
[ "\"\"\"\n This function is designed to label candidates and place the annotations inside a database.\n Will be rarely used since snorkel metal doesn't use a database for annotations.\n Important to keep if I were to go back towards snorkel's original database version\n\n labeler - the labeler object\n ...
[ { "param": "labeler", "type": null }, { "param": "cids_query", "type": null }, { "param": "label_functions", "type": null }, { "param": "apply_existing", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "labeler", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "cids_query", "type": null, "docstring": null, "docstring_t...
b948b6ddb6bec4c6c36614a2966cb603ff448827
ajlee21/snorkeling
modules/utils/notebook_utils/label_matrix_helper.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
_label_candidates_multithread
null
def _label_candidates_multithread(lfs, multitask): """ This function is called when each thread is created. lfs - the label functions to annotate candidates multitask - a boolean that tells the function to label candidates in a multitask format """ while not(candidate_queue.empty()): ...
This function is called when each thread is created. lfs - the label functions to annotate candidates multitask - a boolean that tells the function to label candidates in a multitask format
This function is called when each thread is created. lfs - the label functions to annotate candidates multitask - a boolean that tells the function to label candidates in a multitask format
[ "This", "function", "is", "called", "when", "each", "thread", "is", "created", ".", "lfs", "-", "the", "label", "functions", "to", "annotate", "candidates", "multitask", "-", "a", "boolean", "that", "tells", "the", "function", "to", "label", "candidates", "i...
def _label_candidates_multithread(lfs, multitask): while not(candidate_queue.empty()): candidate = candidate_queue.get() sys.stdout.write("\r{:7d}".format(candidate_queue.qsize())) sys.stdout.flush() if multitask: for task_index, lf_task in enumerate(lfs): ...
[ "def", "_label_candidates_multithread", "(", "lfs", ",", "multitask", ")", ":", "while", "not", "(", "candidate_queue", ".", "empty", "(", ")", ")", ":", "candidate", "=", "candidate_queue", ".", "get", "(", ")", "sys", ".", "stdout", ".", "write", "(", ...
This function is called when each thread is created.
[ "This", "function", "is", "called", "when", "each", "thread", "is", "created", "." ]
[ "\"\"\"\n This function is called when each thread is created.\n\n lfs - the label functions to annotate candidates\n multitask - a boolean that tells the function to label candidates in a multitask format\n \"\"\"", "# put row_index, col_index and data onto a synchronized queue" ]
[ { "param": "lfs", "type": null }, { "param": "multitask", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "lfs", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "multitask", "type": null, "docstring": null, "docstring_tokens...
472a8b430c450c27fafa8a5f4e35174f7ae7eff7
ajlee21/snorkeling
modules/utils/notebook_utils/dataframe_helper.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
create_gen_marginal_df
<not_specific>
def create_gen_marginal_df(L_data, models, lfs_columns, model_names, candidate_ids): """ This function is designed to create a dataframe that will hold the marginals outputted from the generative model L_data - the sparse matrix generated fromt eh label functions models - the list of generative mod...
This function is designed to create a dataframe that will hold the marginals outputted from the generative model L_data - the sparse matrix generated fromt eh label functions models - the list of generative models lfs_columns - a listing of column indexes that correspond to desired label fucntions...
This function is designed to create a dataframe that will hold the marginals outputted from the generative model the sparse matrix generated fromt eh label functions models - the list of generative models lfs_columns - a listing of column indexes that correspond to desired label fucntions model_names - a label for eac...
[ "This", "function", "is", "designed", "to", "create", "a", "dataframe", "that", "will", "hold", "the", "marginals", "outputted", "from", "the", "generative", "model", "the", "sparse", "matrix", "generated", "fromt", "eh", "label", "functions", "models", "-", "...
def create_gen_marginal_df(L_data, models, lfs_columns, model_names, candidate_ids): marginals = [ model.marginals(L_data[:, columns]) for model, columns in zip(models, lfs_columns) ] marginals_df = pd.DataFrame( np.array(marginals).T, columns=model_names ) marginals_df['c...
[ "def", "create_gen_marginal_df", "(", "L_data", ",", "models", ",", "lfs_columns", ",", "model_names", ",", "candidate_ids", ")", ":", "marginals", "=", "[", "model", ".", "marginals", "(", "L_data", "[", ":", ",", "columns", "]", ")", "for", "model", ",",...
This function is designed to create a dataframe that will hold the marginals outputted from the generative model
[ "This", "function", "is", "designed", "to", "create", "a", "dataframe", "that", "will", "hold", "the", "marginals", "outputted", "from", "the", "generative", "model" ]
[ "\"\"\"\n This function is designed to create a dataframe that will hold\n the marginals outputted from the generative model\n\n L_data - the sparse matrix generated fromt eh label functions\n models - the list of generative models\n lfs_columns - a listing of column indexes that correspond to desire...
[ { "param": "L_data", "type": null }, { "param": "models", "type": null }, { "param": "lfs_columns", "type": null }, { "param": "model_names", "type": null }, { "param": "candidate_ids", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "L_data", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "models", "type": null, "docstring": null, "docstring_tokens...
472a8b430c450c27fafa8a5f4e35174f7ae7eff7
ajlee21/snorkeling
modules/utils/notebook_utils/dataframe_helper.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
create_disc_marginal_df
<not_specific>
def create_disc_marginal_df(models, test_data): """ This function is desgined get the predicted marginals from the sklearn models models - list of sklearn models that marginals will be generated from test_data - the dev set data used to generate testing marginals return a dataframe containing mar...
This function is desgined get the predicted marginals from the sklearn models models - list of sklearn models that marginals will be generated from test_data - the dev set data used to generate testing marginals return a dataframe containing marginal probabilities for each sklearn model
This function is desgined get the predicted marginals from the sklearn models models - list of sklearn models that marginals will be generated from the dev set data used to generate testing marginals return a dataframe containing marginal probabilities for each sklearn model
[ "This", "function", "is", "desgined", "get", "the", "predicted", "marginals", "from", "the", "sklearn", "models", "models", "-", "list", "of", "sklearn", "models", "that", "marginals", "will", "be", "generated", "from", "the", "dev", "set", "data", "used", "...
def create_disc_marginal_df(models, test_data): return ( pd.DataFrame([model.best_estimator_.predict_proba(test_data)[:,1] for model in models]) .transpose() .rename(index=str, columns=columns) )
[ "def", "create_disc_marginal_df", "(", "models", ",", "test_data", ")", ":", "return", "(", "pd", ".", "DataFrame", "(", "[", "model", ".", "best_estimator_", ".", "predict_proba", "(", "test_data", ")", "[", ":", ",", "1", "]", "for", "model", "in", "mo...
This function is desgined get the predicted marginals from the sklearn models models - list of sklearn models that marginals will be generated from
[ "This", "function", "is", "desgined", "get", "the", "predicted", "marginals", "from", "the", "sklearn", "models", "models", "-", "list", "of", "sklearn", "models", "that", "marginals", "will", "be", "generated", "from" ]
[ "\"\"\"\n This function is desgined get the predicted marginals from the sklearn models\n\n models - list of sklearn models that marginals will be generated from\n\n test_data - the dev set data used to generate testing marginals\n\n return a dataframe containing marginal probabilities for each sklearn ...
[ { "param": "models", "type": null }, { "param": "test_data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "models", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "test_data", "type": null, "docstring": null, "docstring_tok...
472a8b430c450c27fafa8a5f4e35174f7ae7eff7
ajlee21/snorkeling
modules/utils/notebook_utils/dataframe_helper.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
tag_sentence
<not_specific>
def tag_sentence(x, class_table): """ This function tags the mentions of each candidate sentence. x - dataframe with candidate sentences class_table - the table for each candidate """ candidates=( session .query(class_table) .filter(class_table.id.in_(x.candidate_id.astyp...
This function tags the mentions of each candidate sentence. x - dataframe with candidate sentences class_table - the table for each candidate
This function tags the mentions of each candidate sentence. x - dataframe with candidate sentences class_table - the table for each candidate
[ "This", "function", "tags", "the", "mentions", "of", "each", "candidate", "sentence", ".", "x", "-", "dataframe", "with", "candidate", "sentences", "class_table", "-", "the", "table", "for", "each", "candidate" ]
def tag_sentence(x, class_table): candidates=( session .query(class_table) .filter(class_table.id.in_(x.candidate_id.astype(int).tolist())) .all() ) tagged_sen=[ " ".join( mark_sentence( candidate_to_tokens(cand), [ ...
[ "def", "tag_sentence", "(", "x", ",", "class_table", ")", ":", "candidates", "=", "(", "session", ".", "query", "(", "class_table", ")", ".", "filter", "(", "class_table", ".", "id", ".", "in_", "(", "x", ".", "candidate_id", ".", "astype", "(", "int",...
This function tags the mentions of each candidate sentence.
[ "This", "function", "tags", "the", "mentions", "of", "each", "candidate", "sentence", "." ]
[ "\"\"\"\n This function tags the mentions of each candidate sentence.\n x - dataframe with candidate sentences\n class_table - the table for each candidate\n \"\"\"" ]
[ { "param": "x", "type": null }, { "param": "class_table", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "class_table", "type": null, "docstring": null, "docstring_tokens...
472a8b430c450c27fafa8a5f4e35174f7ae7eff7
ajlee21/snorkeling
modules/utils/notebook_utils/dataframe_helper.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
make_sentence_df
<not_specific>
def make_sentence_df(candidates): """ This function creats a dataframe for all candidates (sentences that contain at least two mentions) located in our database. candidates - a list of candidate objects passed in from sqlalchemy return a Dataframe that contains each candidate sentence and th...
This function creats a dataframe for all candidates (sentences that contain at least two mentions) located in our database. candidates - a list of candidate objects passed in from sqlalchemy return a Dataframe that contains each candidate sentence and the corresponding candidate entities
This function creats a dataframe for all candidates (sentences that contain at least two mentions) located in our database. a list of candidate objects passed in from sqlalchemy return a Dataframe that contains each candidate sentence and the corresponding candidate entities
[ "This", "function", "creats", "a", "dataframe", "for", "all", "candidates", "(", "sentences", "that", "contain", "at", "least", "two", "mentions", ")", "located", "in", "our", "database", ".", "a", "list", "of", "candidate", "objects", "passed", "in", "from"...
def make_sentence_df(candidates): rows = list() for c in tqdm_notebook(candidates): args = [ (c[0].get_word_start(), c[0].get_word_end(), 1), (c[1].get_word_start(), c[1].get_word_end(), 2) ] sen = " ".join(mark_sentence(candidate_to_tokens(c), args)) ...
[ "def", "make_sentence_df", "(", "candidates", ")", ":", "rows", "=", "list", "(", ")", "for", "c", "in", "tqdm_notebook", "(", "candidates", ")", ":", "args", "=", "[", "(", "c", "[", "0", "]", ".", "get_word_start", "(", ")", ",", "c", "[", "0", ...
This function creats a dataframe for all candidates (sentences that contain at least two mentions) located in our database.
[ "This", "function", "creats", "a", "dataframe", "for", "all", "candidates", "(", "sentences", "that", "contain", "at", "least", "two", "mentions", ")", "located", "in", "our", "database", "." ]
[ "\"\"\" \n This function creats a dataframe for all candidates (sentences that contain at least two mentions)\n located in our database.\n \n candidates - a list of candidate objects passed in from sqlalchemy\n\n return a Dataframe that contains each candidate sentence and the corresponding candidat...
[ { "param": "candidates", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "candidates", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
472a8b430c450c27fafa8a5f4e35174f7ae7eff7
ajlee21/snorkeling
modules/utils/notebook_utils/dataframe_helper.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
write_candidates_to_excel
<not_specific>
def write_candidates_to_excel(candidate_df, spreadsheet_name): """ This function is designed to save the candidates to an excel spreadsheet. This is needed for manual curation of candidate sentences candidate_df - the dataframe that holds all the candidates spreadsheet_name - the name of t...
This function is designed to save the candidates to an excel spreadsheet. This is needed for manual curation of candidate sentences candidate_df - the dataframe that holds all the candidates spreadsheet_name - the name of the excel spreadsheet
This function is designed to save the candidates to an excel spreadsheet. This is needed for manual curation of candidate sentences the dataframe that holds all the candidates spreadsheet_name - the name of the excel spreadsheet
[ "This", "function", "is", "designed", "to", "save", "the", "candidates", "to", "an", "excel", "spreadsheet", ".", "This", "is", "needed", "for", "manual", "curation", "of", "candidate", "sentences", "the", "dataframe", "that", "holds", "all", "the", "candidate...
def write_candidates_to_excel(candidate_df, spreadsheet_name): writer = pd.ExcelWriter(spreadsheet_name) ( candidate_df .to_excel(writer, sheet_name='sentences', index=False) ) if writer.engine == 'xlsxwriter': for sheet in writer.sheets.values(): sheet.freeze_panes(1...
[ "def", "write_candidates_to_excel", "(", "candidate_df", ",", "spreadsheet_name", ")", ":", "writer", "=", "pd", ".", "ExcelWriter", "(", "spreadsheet_name", ")", "(", "candidate_df", ".", "to_excel", "(", "writer", ",", "sheet_name", "=", "'sentences'", ",", "i...
This function is designed to save the candidates to an excel spreadsheet.
[ "This", "function", "is", "designed", "to", "save", "the", "candidates", "to", "an", "excel", "spreadsheet", "." ]
[ "\"\"\"\n This function is designed to save the candidates to an excel\n spreadsheet. This is needed for manual curation of candidate \n sentences\n \n candidate_df - the dataframe that holds all the candidates\n spreadsheet_name - the name of the excel spreadsheet\n \"\"\"" ]
[ { "param": "candidate_df", "type": null }, { "param": "spreadsheet_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "candidate_df", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "spreadsheet_name", "type": null, "docstring": null, "...
472a8b430c450c27fafa8a5f4e35174f7ae7eff7
ajlee21/snorkeling
modules/utils/notebook_utils/dataframe_helper.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
load_candidate_dataframes
<not_specific>
def load_candidate_dataframes(filename, curated_field): """ This function reads in the candidates excel files to preform analyses. dataframe - the path of the dataframe to load """ data_df = pd.read_excel(filename) data_df = data_df.query("{}.notnull()".format(curated_field)) return data_df...
This function reads in the candidates excel files to preform analyses. dataframe - the path of the dataframe to load
This function reads in the candidates excel files to preform analyses. dataframe - the path of the dataframe to load
[ "This", "function", "reads", "in", "the", "candidates", "excel", "files", "to", "preform", "analyses", ".", "dataframe", "-", "the", "path", "of", "the", "dataframe", "to", "load" ]
def load_candidate_dataframes(filename, curated_field): data_df = pd.read_excel(filename) data_df = data_df.query("{}.notnull()".format(curated_field)) return data_df.sort_values('candidate_id')
[ "def", "load_candidate_dataframes", "(", "filename", ",", "curated_field", ")", ":", "data_df", "=", "pd", ".", "read_excel", "(", "filename", ")", "data_df", "=", "data_df", ".", "query", "(", "\"{}.notnull()\"", ".", "format", "(", "curated_field", ")", ")",...
This function reads in the candidates excel files to preform analyses.
[ "This", "function", "reads", "in", "the", "candidates", "excel", "files", "to", "preform", "analyses", "." ]
[ "\"\"\"\n This function reads in the candidates excel files to preform analyses.\n\n dataframe - the path of the dataframe to load\n \"\"\"" ]
[ { "param": "filename", "type": null }, { "param": "curated_field", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "filename", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "curated_field", "type": null, "docstring": null, "docstri...
9661a0a1ecee4f24de1e2517a4112f61e5d604f5
ajlee21/snorkeling
playground/disease_gene/generative_model_experiments/data_210/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DG_NEGATIVE_DIRECTION
<not_specific>
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(neg...
This label function is designed to search for words that indicate a sort of negative response or imply an downregulates association
This label function is designed to search for words that indicate a sort of negative response or imply an downregulates association
[ "This", "label", "function", "is", "designed", "to", "search", "for", "words", "that", "indicate", "a", "sort", "of", "negative", "response", "or", "imply", "an", "downregulates", "association" ]
def LF_DG_NEGATIVE_DIRECTION(c): 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_DG_NEGATIVE_DIRECTION", "(", "c", ")", ":", "return", "1", "if", "any", "(", "[", "rule_regex_search_btw_AB", "(", "c", ",", "r'.*'", "+", "ltp", "(", "negative_direction", ")", "+", "r'.*'", ",", "1", ")", ",", "rule_regex_search_btw_BA", "(", ...
This label function is designed to search for words that indicate a sort of negative response or imply an downregulates association
[ "This", "label", "function", "is", "designed", "to", "search", "for", "words", "that", "indicate", "a", "sort", "of", "negative", "response", "or", "imply", "an", "downregulates", "association" ]
[ "\"\"\"\n This label function is designed to search for words that indicate\n a sort of negative response or imply an downregulates association\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9661a0a1ecee4f24de1e2517a4112f61e5d604f5
ajlee21/snorkeling
playground/disease_gene/generative_model_experiments/data_210/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DaG_NO_CONCLUSION
<not_specific>
def LF_DaG_NO_CONCLUSION(c): """ This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association. """ p...
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association.
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association.
[ "This", "label", "function", "fires", "a", "-", "1", "if", "the", "number", "of", "negative", "label", "functinos", "is", "greater", "than", "the", "number", "of", "positive", "label", "functions", ".", "The", "main", "idea", "behind", "this", "label", "fu...
def LF_DaG_NO_CONCLUSION(c): positive_num = np.sum([LF_DG_ASSOCIATION(c), LF_DG_IS_BIOMARKER(c),LF_DG_NO_ASSOCIATION(c), LF_DG_POSITIVE_DIRECTION(c), LF_DG_NEGATIVE_DIRECTION(c), LF_DG_DIAGNOSIS(c), np.abs(LF_DG_WEAK_ASSOCIATION(c)), np.abs(LF_DG_NO_ASSOCIATION(c))]) negative_num = np....
[ "def", "LF_DaG_NO_CONCLUSION", "(", "c", ")", ":", "positive_num", "=", "np", ".", "sum", "(", "[", "LF_DG_ASSOCIATION", "(", "c", ")", ",", "LF_DG_IS_BIOMARKER", "(", "c", ")", ",", "LF_DG_NO_ASSOCIATION", "(", "c", ")", ",", "LF_DG_POSITIVE_DIRECTION", "("...
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions.
[ "This", "label", "function", "fires", "a", "-", "1", "if", "the", "number", "of", "negative", "label", "functinos", "is", "greater", "than", "the", "number", "of", "positive", "label", "functions", "." ]
[ "\"\"\"\n This label function fires a -1 if the number of negative label functinos is greater than the number\n of positive label functions.\n The main idea behind this label function is add support to sentences that could\n mention a possible disease gene association.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9661a0a1ecee4f24de1e2517a4112f61e5d604f5
ajlee21/snorkeling
playground/disease_gene/generative_model_experiments/data_210/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DaG_CONCLUSION
<not_specific>
def LF_DaG_CONCLUSION(c): """ This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association """ if LF_...
This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association
This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association
[ "This", "label", "function", "fires", "a", "1", "if", "the", "number", "of", "positive", "label", "functions", "is", "greater", "than", "the", "number", "of", "negative", "label", "functions", ".", "The", "main", "idea", "behind", "this", "label", "function"...
def LF_DaG_CONCLUSION(c): if LF_DG_NO_ASSOCIATION(c) or LF_DG_WEAK_ASSOCIATION(c): return -1 elif not LF_DaG_NO_CONCLUSION(c): return 1 else: return 0
[ "def", "LF_DaG_CONCLUSION", "(", "c", ")", ":", "if", "LF_DG_NO_ASSOCIATION", "(", "c", ")", "or", "LF_DG_WEAK_ASSOCIATION", "(", "c", ")", ":", "return", "-", "1", "elif", "not", "LF_DaG_NO_CONCLUSION", "(", "c", ")", ":", "return", "1", "else", ":", "r...
This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions.
[ "This", "label", "function", "fires", "a", "1", "if", "the", "number", "of", "positive", "label", "functions", "is", "greater", "than", "the", "number", "of", "negative", "label", "functions", "." ]
[ "\"\"\"\n This label function fires a 1 if the number of positive label functions is greater than the number\n of negative label functions.\n The main idea behind this label function is add support to sentences that could\n mention a possible disease gene association\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9661a0a1ecee4f24de1e2517a4112f61e5d604f5
ajlee21/snorkeling
playground/disease_gene/generative_model_experiments/data_210/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DuG_NO_CONCLUSION
<not_specific>
def LF_DuG_NO_CONCLUSION(c): """ This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association. """ p...
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association.
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association.
[ "This", "label", "function", "fires", "a", "-", "1", "if", "the", "number", "of", "negative", "label", "functinos", "is", "greater", "than", "the", "number", "of", "positive", "label", "functions", ".", "The", "main", "idea", "behind", "this", "label", "fu...
def LF_DuG_NO_CONCLUSION(c): positive_num = np.sum([ LF_DG_POSITIVE_DIRECTION(c) ]) negative_num = np.abs(np.sum(LF_DG_METHOD_DESC(c), LF_DG_TITLE(c))) if positive_num - negative_num >= 1: return 0 return -1
[ "def", "LF_DuG_NO_CONCLUSION", "(", "c", ")", ":", "positive_num", "=", "np", ".", "sum", "(", "[", "LF_DG_POSITIVE_DIRECTION", "(", "c", ")", "]", ")", "negative_num", "=", "np", ".", "abs", "(", "np", ".", "sum", "(", "LF_DG_METHOD_DESC", "(", "c", "...
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions.
[ "This", "label", "function", "fires", "a", "-", "1", "if", "the", "number", "of", "negative", "label", "functinos", "is", "greater", "than", "the", "number", "of", "positive", "label", "functions", "." ]
[ "\"\"\"\n This label function fires a -1 if the number of negative label functinos is greater than the number\n of positive label functions.\n The main idea behind this label function is add support to sentences that could\n mention a possible disease gene association.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9661a0a1ecee4f24de1e2517a4112f61e5d604f5
ajlee21/snorkeling
playground/disease_gene/generative_model_experiments/data_210/label_functions/disease_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_DdG_NO_CONCLUSION
<not_specific>
def LF_DdG_NO_CONCLUSION(c): """ This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association. """ p...
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association.
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association.
[ "This", "label", "function", "fires", "a", "-", "1", "if", "the", "number", "of", "negative", "label", "functinos", "is", "greater", "than", "the", "number", "of", "positive", "label", "functions", ".", "The", "main", "idea", "behind", "this", "label", "fu...
def LF_DdG_NO_CONCLUSION(c): positive_num = np.sum([ LF_DG_NEGATIVE_DIRECTION(c) ]) negative_num = np.abs(np.sum(LF_DG_METHOD_DESC(c), LF_DG_TITLE(c))) if positive_num - negative_num >= 1: return 0 return -1
[ "def", "LF_DdG_NO_CONCLUSION", "(", "c", ")", ":", "positive_num", "=", "np", ".", "sum", "(", "[", "LF_DG_NEGATIVE_DIRECTION", "(", "c", ")", "]", ")", "negative_num", "=", "np", ".", "abs", "(", "np", ".", "sum", "(", "LF_DG_METHOD_DESC", "(", "c", "...
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions.
[ "This", "label", "function", "fires", "a", "-", "1", "if", "the", "number", "of", "negative", "label", "functinos", "is", "greater", "than", "the", "number", "of", "positive", "label", "functions", "." ]
[ "\"\"\"\n This label function fires a -1 if the number of negative label functinos is greater than the number\n of positive label functions.\n The main idea behind this label function is add support to sentences that could\n mention a possible disease gene association.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_HETNET_CD_ABSENT
<not_specific>
def LF_HETNET_CD_ABSENT(c): """ This label function fires -1 if the given Disease Gene pair does not appear in the databases above. """ return 0 if any([ LF_HETNET_PHARMACOTHERAPYDB(c) ]) else -1
This label function fires -1 if the given Disease Gene pair does not appear in the databases above.
This label function fires -1 if the given Disease Gene pair does not appear in the databases above.
[ "This", "label", "function", "fires", "-", "1", "if", "the", "given", "Disease", "Gene", "pair", "does", "not", "appear", "in", "the", "databases", "above", "." ]
def LF_HETNET_CD_ABSENT(c): return 0 if any([ LF_HETNET_PHARMACOTHERAPYDB(c) ]) else -1
[ "def", "LF_HETNET_CD_ABSENT", "(", "c", ")", ":", "return", "0", "if", "any", "(", "[", "LF_HETNET_PHARMACOTHERAPYDB", "(", "c", ")", "]", ")", "else", "-", "1" ]
This label function fires -1 if the given Disease Gene pair does not appear in the databases above.
[ "This", "label", "function", "fires", "-", "1", "if", "the", "given", "Disease", "Gene", "pair", "does", "not", "appear", "in", "the", "databases", "above", "." ]
[ "\"\"\"\n This label function fires -1 if the given Disease Gene pair does not appear \n in the databases above.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_CHECK_DISEASE_TAG
<not_specific>
def LF_CD_CHECK_DISEASE_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() disease_name = re.sub("\) ?", "", c[1].get_span()) disease_name = re.sub(r"(\w)-(\w)...
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_CD_CHECK_DISEASE_TAG(c): sen = c[1].get_parent() disease_name = re.sub("\) ?", "", c[1].get_span()) disease_name = re.sub(r"(\w)-(\w)", r"\g<1> \g<2>", disease_name) disease_name = " ".join([word for word in word_tokenize(disease_name) if word not in set(stop_word_list)]) if len(disease_name)...
[ "def", "LF_CD_CHECK_DISEASE_TAG", "(", "c", ")", ":", "sen", "=", "c", "[", "1", "]", ".", "get_parent", "(", ")", "disease_name", "=", "re", ".", "sub", "(", "\"\\) ?\"", ",", "\"\"", ",", "c", "[", "1", "]", ".", "get_span", "(", ")", ")", "dis...
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", "." ]
[ "\"\"\"\n This label function is used for labeling each passed candidate as either pos or neg.\n Keyword Args:\n c- the candidate object to be passed in.\n \"\"\"", "# If abbreviation skip since no means of easy resolution", "# If no match then return -1", "# check the reverse direction e.g. carci...
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_WEAKLY_TREATS
<not_specific>
def LF_CD_WEAKLY_TREATS(c): """ This label function is designed to look for phrases that imply a compound binding to a gene/protein """ if re.search(ltp(weak_treatment_indications), get_text_between(c), flags=re.I): return 1 elif re.search(ltp(weak_treatment_indications), " ".join(get_le...
This label function is designed to look for phrases that imply a compound binding to a gene/protein
This label function is designed to look for phrases that imply a compound binding to a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "imply", "a", "compound", "binding", "to", "a", "gene", "/", "protein" ]
def LF_CD_WEAKLY_TREATS(c): if re.search(ltp(weak_treatment_indications), get_text_between(c), flags=re.I): return 1 elif re.search(ltp(weak_treatment_indications), " ".join(get_left_tokens(c[0], window=5)), flags=re.I): return 1 elif re.search(ltp(weak_treatment_indications), " ".join(get_r...
[ "def", "LF_CD_WEAKLY_TREATS", "(", "c", ")", ":", "if", "re", ".", "search", "(", "ltp", "(", "weak_treatment_indications", ")", ",", "get_text_between", "(", "c", ")", ",", "flags", "=", "re", ".", "I", ")", ":", "return", "1", "elif", "re", ".", "s...
This label function is designed to look for phrases that imply a compound binding to a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "imply", "a", "compound", "binding", "to", "a", "gene", "/", "protein" ]
[ "\"\"\"\n This label function is designed to look for phrases\n that imply a compound binding to a gene/protein\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_PALLIATES
<not_specific>
def LF_CD_PALLIATES(c): """ This label function is designed to look for phrases that could imply a compound binding to a gene/protein """ if re.search(ltp(palliates_indication), get_text_between(c), flags=re.I): return 1 elif re.search(ltp(palliates_indication), " ".join(get_left_tokens(...
This label function is designed to look for phrases that could imply a compound binding to a gene/protein
This label function is designed to look for phrases that could imply a compound binding to a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "could", "imply", "a", "compound", "binding", "to", "a", "gene", "/", "protein" ]
def LF_CD_PALLIATES(c): if re.search(ltp(palliates_indication), get_text_between(c), flags=re.I): return 1 elif re.search(ltp(palliates_indication), " ".join(get_left_tokens(c[0], window=5)), flags=re.I): return 1 elif re.search(ltp(palliates_indication), " ".join(get_right_tokens(c[0], wind...
[ "def", "LF_CD_PALLIATES", "(", "c", ")", ":", "if", "re", ".", "search", "(", "ltp", "(", "palliates_indication", ")", ",", "get_text_between", "(", "c", ")", ",", "flags", "=", "re", ".", "I", ")", ":", "return", "1", "elif", "re", ".", "search", ...
This label function is designed to look for phrases that could imply a compound binding to a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "could", "imply", "a", "compound", "binding", "to", "a", "gene", "/", "protein" ]
[ "\"\"\"\n This label function is designed to look for phrases\n that could imply a compound binding to a gene/protein\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_COMPOUND_INDICATION
<not_specific>
def LF_CD_COMPOUND_INDICATION(c): """ This label function is designed to look for phrases that implies a compound increaseing activity of a gene/protein """ if re.search(ltp(compound_indications), get_text_between(c), flags=re.I): return 1 elif re.search(ltp(compound_indications), " ".jo...
This label function is designed to look for phrases that implies a compound increaseing activity of a gene/protein
This label function is designed to look for phrases that implies a compound increaseing activity of a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "implies", "a", "compound", "increaseing", "activity", "of", "a", "gene", "/", "protein" ]
def LF_CD_COMPOUND_INDICATION(c): if re.search(ltp(compound_indications), get_text_between(c), flags=re.I): return 1 elif re.search(ltp(compound_indications), " ".join(get_left_tokens(c[0], window=5)), flags=re.I): return 1 elif re.search(ltp(compound_indications), " ".join(get_right_tokens(...
[ "def", "LF_CD_COMPOUND_INDICATION", "(", "c", ")", ":", "if", "re", ".", "search", "(", "ltp", "(", "compound_indications", ")", ",", "get_text_between", "(", "c", ")", ",", "flags", "=", "re", ".", "I", ")", ":", "return", "1", "elif", "re", ".", "s...
This label function is designed to look for phrases that implies a compound increaseing activity of a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "implies", "a", "compound", "increaseing", "activity", "of", "a", "gene", "/", "protein" ]
[ "\"\"\"\n This label function is designed to look for phrases\n that implies a compound increaseing activity of a gene/protein\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_IN_SERIES
<not_specific>
def LF_CD_IN_SERIES(c): """ This label function is designed to look for a mention being caught in a series of other genes or compounds """ if len(re.findall(r',', get_tagged_text(c))) >= 2: if re.search(', and', get_tagged_text(c)): return -1 if re.search(r"\(a\)|\(b\)|\(c\)"...
This label function is designed to look for a mention being caught in a series of other genes or compounds
This label function is designed to look for a mention being caught in a series of other genes or compounds
[ "This", "label", "function", "is", "designed", "to", "look", "for", "a", "mention", "being", "caught", "in", "a", "series", "of", "other", "genes", "or", "compounds" ]
def LF_CD_IN_SERIES(c): if len(re.findall(r',', get_tagged_text(c))) >= 2: if re.search(', and', get_tagged_text(c)): return -1 if re.search(r"\(a\)|\(b\)|\(c\)", get_tagged_text(c)): return -1 return 0
[ "def", "LF_CD_IN_SERIES", "(", "c", ")", ":", "if", "len", "(", "re", ".", "findall", "(", "r','", ",", "get_tagged_text", "(", "c", ")", ")", ")", ">=", "2", ":", "if", "re", ".", "search", "(", "', and'", ",", "get_tagged_text", "(", "c", ")", ...
This label function is designed to look for a mention being caught in a series of other genes or compounds
[ "This", "label", "function", "is", "designed", "to", "look", "for", "a", "mention", "being", "caught", "in", "a", "series", "of", "other", "genes", "or", "compounds" ]
[ "\"\"\"\n This label function is designed to look for a mention being caught\n in a series of other genes or compounds\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_METHOD_DESC
<not_specific>
def LF_CD_METHOD_DESC(c): """ This label function is designed to look for phrases that imply a sentence is description an experimental design """ if re.search(ltp(method_indication), get_tagged_text(c), flags=re.I): return -1 else: return 0
This label function is designed to look for phrases that imply a sentence is description an experimental design
This label function is designed to look for phrases that imply a sentence is description an experimental design
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "imply", "a", "sentence", "is", "description", "an", "experimental", "design" ]
def LF_CD_METHOD_DESC(c): if re.search(ltp(method_indication), get_tagged_text(c), flags=re.I): return -1 else: return 0
[ "def", "LF_CD_METHOD_DESC", "(", "c", ")", ":", "if", "re", ".", "search", "(", "ltp", "(", "method_indication", ")", ",", "get_tagged_text", "(", "c", ")", ",", "flags", "=", "re", ".", "I", ")", ":", "return", "-", "1", "else", ":", "return", "0"...
This label function is designed to look for phrases that imply a sentence is description an experimental design
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "imply", "a", "sentence", "is", "description", "an", "experimental", "design" ]
[ "\"\"\"\n This label function is designed to look for phrases \n that imply a sentence is description an experimental design\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_NO_CONCLUSION
<not_specific>
def LF_CD_NO_CONCLUSION(c): """ This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association. """ po...
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association.
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association.
[ "This", "label", "function", "fires", "a", "-", "1", "if", "the", "number", "of", "negative", "label", "functinos", "is", "greater", "than", "the", "number", "of", "positive", "label", "functions", ".", "The", "main", "idea", "behind", "this", "label", "fu...
def LF_CD_NO_CONCLUSION(c): positive_num = np.sum([ LF_CD_TREATS(c), LF_CD_CHECK_DEPRESSION_USAGE(c), LF_CD_WEAKLY_TREATS(c), LF_CD_PALLIATES(c), LF_CD_COMPOUND_INDICATION(c), LF_CD_TRIAL(c)]) negative_num = np.abs(np.sum([LF_CD_METHOD_DESC(c), LF_CD_IN_SERIES(c)]...
[ "def", "LF_CD_NO_CONCLUSION", "(", "c", ")", ":", "positive_num", "=", "np", ".", "sum", "(", "[", "LF_CD_TREATS", "(", "c", ")", ",", "LF_CD_CHECK_DEPRESSION_USAGE", "(", "c", ")", ",", "LF_CD_WEAKLY_TREATS", "(", "c", ")", ",", "LF_CD_PALLIATES", "(", "c...
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions.
[ "This", "label", "function", "fires", "a", "-", "1", "if", "the", "number", "of", "negative", "label", "functinos", "is", "greater", "than", "the", "number", "of", "positive", "label", "functions", "." ]
[ "\"\"\"\n This label function fires a -1 if the number of negative label functinos is greater than the number\n of positive label functions.\n The main idea behind this label function is add support to sentences that could\n mention a possible disease gene association.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_CONCLUSION
<not_specific>
def LF_CD_CONCLUSION(c): """ This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association """ if not ...
This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association
This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association
[ "This", "label", "function", "fires", "a", "1", "if", "the", "number", "of", "positive", "label", "functions", "is", "greater", "than", "the", "number", "of", "negative", "label", "functions", ".", "The", "main", "idea", "behind", "this", "label", "function"...
def LF_CD_CONCLUSION(c): if not LF_CD_NO_CONCLUSION(c): return 1 else: return 0
[ "def", "LF_CD_CONCLUSION", "(", "c", ")", ":", "if", "not", "LF_CD_NO_CONCLUSION", "(", "c", ")", ":", "return", "1", "else", ":", "return", "0" ]
This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions.
[ "This", "label", "function", "fires", "a", "1", "if", "the", "number", "of", "positive", "label", "functions", "is", "greater", "than", "the", "number", "of", "negative", "label", "functions", "." ]
[ "\"\"\"\n This label function fires a 1 if the number of positive label functions is greater than the number\n of negative label functions.\n The main idea behind this label function is add support to sentences that could\n mention a possible disease gene association\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_DISTANCE_SHORT
<not_specific>
def LF_CD_DISTANCE_SHORT(c): """ This LF is designed to make sure that the compound mention and the gene mention aren't right next to each other. """ return -1 if len(list(get_between_tokens(c))) <= 2 else 0
This LF is designed to make sure that the compound mention and the gene mention aren't right next to each other.
This LF is designed to make sure that the compound mention and the gene mention aren't right next to each other.
[ "This", "LF", "is", "designed", "to", "make", "sure", "that", "the", "compound", "mention", "and", "the", "gene", "mention", "aren", "'", "t", "right", "next", "to", "each", "other", "." ]
def LF_CD_DISTANCE_SHORT(c): return -1 if len(list(get_between_tokens(c))) <= 2 else 0
[ "def", "LF_CD_DISTANCE_SHORT", "(", "c", ")", ":", "return", "-", "1", "if", "len", "(", "list", "(", "get_between_tokens", "(", "c", ")", ")", ")", "<=", "2", "else", "0" ]
This LF is designed to make sure that the compound mention and the gene mention aren't right next to each other.
[ "This", "LF", "is", "designed", "to", "make", "sure", "that", "the", "compound", "mention", "and", "the", "gene", "mention", "aren", "'", "t", "right", "next", "to", "each", "other", "." ]
[ "\"\"\"\n This LF is designed to make sure that the compound mention\n and the gene mention aren't right next to each other.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_DISTANCE_LONG
<not_specific>
def LF_CD_DISTANCE_LONG(c): """ This LF is designed to make sure that the compound mention and the gene mention aren't too far from each other. """ return -1 if len(list(get_between_tokens(c))) > 25 else 0
This LF is designed to make sure that the compound mention and the gene mention aren't too far from each other.
This LF is designed to make sure that the compound mention and the gene mention aren't too far from each other.
[ "This", "LF", "is", "designed", "to", "make", "sure", "that", "the", "compound", "mention", "and", "the", "gene", "mention", "aren", "'", "t", "too", "far", "from", "each", "other", "." ]
def LF_CD_DISTANCE_LONG(c): return -1 if len(list(get_between_tokens(c))) > 25 else 0
[ "def", "LF_CD_DISTANCE_LONG", "(", "c", ")", ":", "return", "-", "1", "if", "len", "(", "list", "(", "get_between_tokens", "(", "c", ")", ")", ")", ">", "25", "else", "0" ]
This LF is designed to make sure that the compound mention and the gene mention aren't too far from each other.
[ "This", "LF", "is", "designed", "to", "make", "sure", "that", "the", "compound", "mention", "and", "the", "gene", "mention", "aren", "'", "t", "too", "far", "from", "each", "other", "." ]
[ "\"\"\"\n This LF is designed to make sure that the compound mention\n and the gene mention aren't too far from each other.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_ALLOWED_DISTANCE
<not_specific>
def LF_CD_ALLOWED_DISTANCE(c): """ This LF is designed to make sure that the compound mention and the gene mention are in an acceptable distance between each other """ return 0 if any([ LF_CD_DISTANCE_LONG(c), LF_CD_DISTANCE_SHORT(c) ]) else 1 if random.random() < 0.65 e...
This LF is designed to make sure that the compound mention and the gene mention are in an acceptable distance between each other
This LF is designed to make sure that the compound mention and the gene mention are in an acceptable distance between each other
[ "This", "LF", "is", "designed", "to", "make", "sure", "that", "the", "compound", "mention", "and", "the", "gene", "mention", "are", "in", "an", "acceptable", "distance", "between", "each", "other" ]
def LF_CD_ALLOWED_DISTANCE(c): return 0 if any([ LF_CD_DISTANCE_LONG(c), LF_CD_DISTANCE_SHORT(c) ]) else 1 if random.random() < 0.65 else 0
[ "def", "LF_CD_ALLOWED_DISTANCE", "(", "c", ")", ":", "return", "0", "if", "any", "(", "[", "LF_CD_DISTANCE_LONG", "(", "c", ")", ",", "LF_CD_DISTANCE_SHORT", "(", "c", ")", "]", ")", "else", "1", "if", "random", ".", "random", "(", ")", "<", "0.65", ...
This LF is designed to make sure that the compound mention and the gene mention are in an acceptable distance between each other
[ "This", "LF", "is", "designed", "to", "make", "sure", "that", "the", "compound", "mention", "and", "the", "gene", "mention", "are", "in", "an", "acceptable", "distance", "between", "each", "other" ]
[ "\"\"\"\n This LF is designed to make sure that the compound mention\n and the gene mention are in an acceptable distance between \n each other\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_NO_VERB
<not_specific>
def LF_CD_NO_VERB(c): """ This label function is designed to fire if a given sentence doesn't contain a verb. Helps cut out some of the titles hidden in Pubtator abstracts """ if len([x for x in nltk.pos_tag(word_tokenize(c.get_parent().text)) if "VB" in x[1]]) == 0: if "correlates with...
This label function is designed to fire if a given sentence doesn't contain a verb. Helps cut out some of the titles hidden in Pubtator abstracts
This label function is designed to fire if a given sentence doesn't contain a verb. Helps cut out some of the titles hidden in Pubtator abstracts
[ "This", "label", "function", "is", "designed", "to", "fire", "if", "a", "given", "sentence", "doesn", "'", "t", "contain", "a", "verb", ".", "Helps", "cut", "out", "some", "of", "the", "titles", "hidden", "in", "Pubtator", "abstracts" ]
def LF_CD_NO_VERB(c): if len([x for x in nltk.pos_tag(word_tokenize(c.get_parent().text)) if "VB" in x[1]]) == 0: if "correlates with" in c.get_parent().text: return 0 return -1 return 0
[ "def", "LF_CD_NO_VERB", "(", "c", ")", ":", "if", "len", "(", "[", "x", "for", "x", "in", "nltk", ".", "pos_tag", "(", "word_tokenize", "(", "c", ".", "get_parent", "(", ")", ".", "text", ")", ")", "if", "\"VB\"", "in", "x", "[", "1", "]", "]",...
This label function is designed to fire if a given sentence doesn't contain a verb.
[ "This", "label", "function", "is", "designed", "to", "fire", "if", "a", "given", "sentence", "doesn", "'", "t", "contain", "a", "verb", "." ]
[ "\"\"\"\n This label function is designed to fire if a given\n sentence doesn't contain a verb. Helps cut out some of the titles\n hidden in Pubtator abstracts\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_PARENTHETICAL_DESC
<not_specific>
def LF_CD_PARENTHETICAL_DESC(c): """ This label function looks for mentions that are in paranthesis. Some of the gene mentions are abbreviations rather than names of a gene. """ if ")" in c[1].get_span() and "(" in list(get_left_tokens(c[1], window=1)): if LF_CD_DISTANCE_SHORT(c): ...
This label function looks for mentions that are in paranthesis. Some of the gene mentions are abbreviations rather than names of a gene.
This label function looks for mentions that are in paranthesis. Some of the gene mentions are abbreviations rather than names of a gene.
[ "This", "label", "function", "looks", "for", "mentions", "that", "are", "in", "paranthesis", ".", "Some", "of", "the", "gene", "mentions", "are", "abbreviations", "rather", "than", "names", "of", "a", "gene", "." ]
def LF_CD_PARENTHETICAL_DESC(c): if ")" in c[1].get_span() and "(" in list(get_left_tokens(c[1], window=1)): if LF_CD_DISTANCE_SHORT(c): return -1 return 0
[ "def", "LF_CD_PARENTHETICAL_DESC", "(", "c", ")", ":", "if", "\")\"", "in", "c", "[", "1", "]", ".", "get_span", "(", ")", "and", "\"(\"", "in", "list", "(", "get_left_tokens", "(", "c", "[", "1", "]", ",", "window", "=", "1", ")", ")", ":", "if"...
This label function looks for mentions that are in paranthesis.
[ "This", "label", "function", "looks", "for", "mentions", "that", "are", "in", "paranthesis", "." ]
[ "\"\"\"\n This label function looks for mentions that are in paranthesis.\n Some of the gene mentions are abbreviations rather than names of a gene.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_BICLUSTER_TREATMENT
<not_specific>
def LF_CD_BICLUSTER_TREATMENT(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@s...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_CD_BICLUSTER_TREATMENT(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["T"].sum() > 0.0: return 1 return 0
[ "def", "LF_CD_BICLUSTER_TREATMENT", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query", "...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_BICLUSTER_INHIBITS
<not_specific>
def LF_CD_BICLUSTER_INHIBITS(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@se...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_CD_BICLUSTER_INHIBITS(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["C"].sum() > 0.0: return 1 return 0
[ "def", "LF_CD_BICLUSTER_INHIBITS", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query", "(...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_BICLUSTER_SIDE_EFFECT
<not_specific>
def LF_CD_BICLUSTER_SIDE_EFFECT(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_CD_BICLUSTER_SIDE_EFFECT(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["Sa"].sum() > 0.0: return 1 return 0
[ "def", "LF_CD_BICLUSTER_SIDE_EFFECT", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query", ...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_BICLUSTER_PREVENTS
<not_specific>
def LF_CD_BICLUSTER_PREVENTS(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@se...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_CD_BICLUSTER_PREVENTS(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["Pr"].sum() > 0.0: return 1 return 0
[ "def", "LF_CD_BICLUSTER_PREVENTS", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query", "(...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_BICLUSTER_ALLEVIATES
<not_specific>
def LF_CD_BICLUSTER_ALLEVIATES(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_CD_BICLUSTER_ALLEVIATES(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["Pa"].sum() > 0.0: return 1 return 0
[ "def", "LF_CD_BICLUSTER_ALLEVIATES", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query", ...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_BICLUSTER_DISEASE_ROLE
<not_specific>
def LF_CD_BICLUSTER_DISEASE_ROLE(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num=...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_CD_BICLUSTER_DISEASE_ROLE(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["J"].sum() > 0.0: return 1 return 0
[ "def", "LF_CD_BICLUSTER_DISEASE_ROLE", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query", ...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13165b1ff01e6a231e6aab2b39e34461dc912c0b
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_BICLUSTER_BIOMARKERS
<not_specific>
def LF_CD_BICLUSTER_BIOMARKERS(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_CD_BICLUSTER_BIOMARKERS(c): sen_pos = c.get_parent().position pubmed_id = c.get_parent().document.name query = bicluster_dep_df.query("pubmed_id==@pubmed_id&sentence_num==@sen_pos") if not(query.empty): if query["Mp"].sum() > 0.0: return 1 return 0
[ "def", "LF_CD_BICLUSTER_BIOMARKERS", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", "query", "=", "bicluster_dep_df", ".", "query", ...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
632f68101e917b3144c8b44add82507d0cfe429f
ajlee21/snorkeling
compound_disease/compound_treats_disease/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CtD_WEAKLY_TREATS
<not_specific>
def LF_CtD_WEAKLY_TREATS(c): """ This label function is designed to look for phrases that have a weak implication towards a compound treating a disease """ if re.search(ltp(weak_treatment_indications), get_text_between(c), flags=re.I): return 1 elif re.search(ltp(weak_treatment_indicatio...
This label function is designed to look for phrases that have a weak implication towards a compound treating a disease
This label function is designed to look for phrases that have a weak implication towards a compound treating a disease
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "have", "a", "weak", "implication", "towards", "a", "compound", "treating", "a", "disease" ]
def LF_CtD_WEAKLY_TREATS(c): if re.search(ltp(weak_treatment_indications), get_text_between(c), flags=re.I): return 1 elif re.search(ltp(weak_treatment_indications), " ".join(get_left_tokens(c[0], window=5)), flags=re.I): return 1 elif re.search(ltp(weak_treatment_indications), " ".join(get_...
[ "def", "LF_CtD_WEAKLY_TREATS", "(", "c", ")", ":", "if", "re", ".", "search", "(", "ltp", "(", "weak_treatment_indications", ")", ",", "get_text_between", "(", "c", ")", ",", "flags", "=", "re", ".", "I", ")", ":", "return", "1", "elif", "re", ".", "...
This label function is designed to look for phrases that have a weak implication towards a compound treating a disease
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "have", "a", "weak", "implication", "towards", "a", "compound", "treating", "a", "disease" ]
[ "\"\"\"\n This label function is designed to look for phrases\n that have a weak implication towards a compound treating a disease\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
632f68101e917b3144c8b44add82507d0cfe429f
ajlee21/snorkeling
compound_disease/compound_treats_disease/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_INCORRECT_COMPOUND
<not_specific>
def LF_CD_INCORRECT_COMPOUND(c): """ This label function is designed to capture phrases that indicate the mentioned compound is a protein not a drug """ if re.search(ltp(incorrect_compound_indications), " ".join(get_left_tokens(c[0], window=5)), flags=re.I): return -1 elif re.search(ltp(...
This label function is designed to capture phrases that indicate the mentioned compound is a protein not a drug
This label function is designed to capture phrases that indicate the mentioned compound is a protein not a drug
[ "This", "label", "function", "is", "designed", "to", "capture", "phrases", "that", "indicate", "the", "mentioned", "compound", "is", "a", "protein", "not", "a", "drug" ]
def LF_CD_INCORRECT_COMPOUND(c): if re.search(ltp(incorrect_compound_indications), " ".join(get_left_tokens(c[0], window=5)), flags=re.I): return -1 elif re.search(ltp(incorrect_compound_indications), " ".join(get_right_tokens(c[0], window=5)), flags=re.I): return -1 else: return 0
[ "def", "LF_CD_INCORRECT_COMPOUND", "(", "c", ")", ":", "if", "re", ".", "search", "(", "ltp", "(", "incorrect_compound_indications", ")", ",", "\" \"", ".", "join", "(", "get_left_tokens", "(", "c", "[", "0", "]", ",", "window", "=", "5", ")", ")", ","...
This label function is designed to capture phrases that indicate the mentioned compound is a protein not a drug
[ "This", "label", "function", "is", "designed", "to", "capture", "phrases", "that", "indicate", "the", "mentioned", "compound", "is", "a", "protein", "not", "a", "drug" ]
[ "\"\"\"\n This label function is designed to capture phrases\n that indicate the mentioned compound is a protein not a drug\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
632f68101e917b3144c8b44add82507d0cfe429f
ajlee21/snorkeling
compound_disease/compound_treats_disease/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CpD_PALLIATES
<not_specific>
def LF_CpD_PALLIATES(c): """ This label function is designed to look for phrases that could imply a compound binding to a gene/protein """ if re.search(ltp(palliates_indication), get_text_between(c), flags=re.I): return 1 elif re.search(ltp(palliates_indication), " ".join(get_left_tokens...
This label function is designed to look for phrases that could imply a compound binding to a gene/protein
This label function is designed to look for phrases that could imply a compound binding to a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "could", "imply", "a", "compound", "binding", "to", "a", "gene", "/", "protein" ]
def LF_CpD_PALLIATES(c): if re.search(ltp(palliates_indication), get_text_between(c), flags=re.I): return 1 elif re.search(ltp(palliates_indication), " ".join(get_left_tokens(c[0], window=5)), flags=re.I): return 1 elif re.search(ltp(palliates_indication), " ".join(get_right_tokens(c[0], win...
[ "def", "LF_CpD_PALLIATES", "(", "c", ")", ":", "if", "re", ".", "search", "(", "ltp", "(", "palliates_indication", ")", ",", "get_text_between", "(", "c", ")", ",", "flags", "=", "re", ".", "I", ")", ":", "return", "1", "elif", "re", ".", "search", ...
This label function is designed to look for phrases that could imply a compound binding to a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "could", "imply", "a", "compound", "binding", "to", "a", "gene", "/", "protein" ]
[ "\"\"\"\n This label function is designed to look for phrases\n that could imply a compound binding to a gene/protein\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
632f68101e917b3144c8b44add82507d0cfe429f
ajlee21/snorkeling
compound_disease/compound_treats_disease/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CtD_COMPOUND_INDICATION
<not_specific>
def LF_CtD_COMPOUND_INDICATION(c): """ This label function is designed to look for phrases that implies a compound increaseing activity of a gene/protein """ if re.search(ltp(compound_indications), get_text_between(c), flags=re.I): return 1 elif re.search(ltp(compound_indications), " ".j...
This label function is designed to look for phrases that implies a compound increaseing activity of a gene/protein
This label function is designed to look for phrases that implies a compound increaseing activity of a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "implies", "a", "compound", "increaseing", "activity", "of", "a", "gene", "/", "protein" ]
def LF_CtD_COMPOUND_INDICATION(c): if re.search(ltp(compound_indications), get_text_between(c), flags=re.I): return 1 elif re.search(ltp(compound_indications), " ".join(get_left_tokens(c[0], window=5)), flags=re.I): return 1 elif re.search(ltp(compound_indications), " ".join(get_right_tokens...
[ "def", "LF_CtD_COMPOUND_INDICATION", "(", "c", ")", ":", "if", "re", ".", "search", "(", "ltp", "(", "compound_indications", ")", ",", "get_text_between", "(", "c", ")", ",", "flags", "=", "re", ".", "I", ")", ":", "return", "1", "elif", "re", ".", "...
This label function is designed to look for phrases that implies a compound increaseing activity of a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "implies", "a", "compound", "increaseing", "activity", "of", "a", "gene", "/", "protein" ]
[ "\"\"\"\n This label function is designed to look for phrases\n that implies a compound increaseing activity of a gene/protein\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
632f68101e917b3144c8b44add82507d0cfe429f
ajlee21/snorkeling
compound_disease/compound_treats_disease/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_TITLE
<not_specific>
def LF_CD_TITLE(c): """ This label function is designed to look for phrases that imply a sentence is the title """ if re.search(r'^(\[|\[ )?'+ltp(title_indication), get_tagged_text(c), flags=re.I): return -1 elif re.search(ltp(title_indication)+r'$', get_tagged_text(c), flags=re.I): ...
This label function is designed to look for phrases that imply a sentence is the title
This label function is designed to look for phrases that imply a sentence is the title
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "imply", "a", "sentence", "is", "the", "title" ]
def LF_CD_TITLE(c): if re.search(r'^(\[|\[ )?'+ltp(title_indication), get_tagged_text(c), flags=re.I): return -1 elif re.search(ltp(title_indication)+r'$', get_tagged_text(c), flags=re.I): return -1 elif "(author's transl)" in get_tagged_text(c): return -1 elif ":" in get_between...
[ "def", "LF_CD_TITLE", "(", "c", ")", ":", "if", "re", ".", "search", "(", "r'^(\\[|\\[ )?'", "+", "ltp", "(", "title_indication", ")", ",", "get_tagged_text", "(", "c", ")", ",", "flags", "=", "re", ".", "I", ")", ":", "return", "-", "1", "elif", "...
This label function is designed to look for phrases that imply a sentence is the title
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "imply", "a", "sentence", "is", "the", "title" ]
[ "\"\"\"\n This label function is designed to look for phrases \n that imply a sentence is the title\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
632f68101e917b3144c8b44add82507d0cfe429f
ajlee21/snorkeling
compound_disease/compound_treats_disease/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CtD_NO_CONCLUSION
<not_specific>
def LF_CtD_NO_CONCLUSION(c): """ This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association. """ p...
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association.
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association.
[ "This", "label", "function", "fires", "a", "-", "1", "if", "the", "number", "of", "negative", "label", "functinos", "is", "greater", "than", "the", "number", "of", "positive", "label", "functions", ".", "The", "main", "idea", "behind", "this", "label", "fu...
def LF_CtD_NO_CONCLUSION(c): positive_num = np.sum([ LF_CtD_TREATS(c), LF_CD_CHECK_DEPRESSION_USAGE(c), LF_CtD_WEAKLY_TREATS(c), LF_CtD_COMPOUND_INDICATION(c), LF_CtD_TRIAL(c)]) negative_num = np.abs(np.sum([LF_CD_METHOD_DESC(c), LF_CD_IN_SERIES(c)])) if positive_num ...
[ "def", "LF_CtD_NO_CONCLUSION", "(", "c", ")", ":", "positive_num", "=", "np", ".", "sum", "(", "[", "LF_CtD_TREATS", "(", "c", ")", ",", "LF_CD_CHECK_DEPRESSION_USAGE", "(", "c", ")", ",", "LF_CtD_WEAKLY_TREATS", "(", "c", ")", ",", "LF_CtD_COMPOUND_INDICATION...
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions.
[ "This", "label", "function", "fires", "a", "-", "1", "if", "the", "number", "of", "negative", "label", "functinos", "is", "greater", "than", "the", "number", "of", "positive", "label", "functions", "." ]
[ "\"\"\"\n This label function fires a -1 if the number of negative label functinos is greater than the number\n of positive label functions.\n The main idea behind this label function is add support to sentences that could\n mention a possible disease gene association.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
632f68101e917b3144c8b44add82507d0cfe429f
ajlee21/snorkeling
compound_disease/compound_treats_disease/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CtD_CONCLUSION
<not_specific>
def LF_CtD_CONCLUSION(c): """ This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association """ if not...
This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association
This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association
[ "This", "label", "function", "fires", "a", "1", "if", "the", "number", "of", "positive", "label", "functions", "is", "greater", "than", "the", "number", "of", "negative", "label", "functions", ".", "The", "main", "idea", "behind", "this", "label", "function"...
def LF_CtD_CONCLUSION(c): if not LF_CtD_NO_CONCLUSION(c): return 1 else: return 0
[ "def", "LF_CtD_CONCLUSION", "(", "c", ")", ":", "if", "not", "LF_CtD_NO_CONCLUSION", "(", "c", ")", ":", "return", "1", "else", ":", "return", "0" ]
This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions.
[ "This", "label", "function", "fires", "a", "1", "if", "the", "number", "of", "positive", "label", "functions", "is", "greater", "than", "the", "number", "of", "negative", "label", "functions", "." ]
[ "\"\"\"\n This label function fires a 1 if the number of positive label functions is greater than the number\n of negative label functions.\n The main idea behind this label function is add support to sentences that could\n mention a possible disease gene association\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
632f68101e917b3144c8b44add82507d0cfe429f
ajlee21/snorkeling
compound_disease/compound_treats_disease/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_ALLOWED_DISTANCE
<not_specific>
def LF_CD_ALLOWED_DISTANCE(c): """ This LF is designed to make sure that the compound mention and the gene mention are in an acceptable distance between each other """ return 0 if any([ LF_CD_DISTANCE_LONG(c), LF_CD_DISTANCE_SHORT(c) ]) else 1
This LF is designed to make sure that the compound mention and the gene mention are in an acceptable distance between each other
This LF is designed to make sure that the compound mention and the gene mention are in an acceptable distance between each other
[ "This", "LF", "is", "designed", "to", "make", "sure", "that", "the", "compound", "mention", "and", "the", "gene", "mention", "are", "in", "an", "acceptable", "distance", "between", "each", "other" ]
def LF_CD_ALLOWED_DISTANCE(c): return 0 if any([ LF_CD_DISTANCE_LONG(c), LF_CD_DISTANCE_SHORT(c) ]) else 1
[ "def", "LF_CD_ALLOWED_DISTANCE", "(", "c", ")", ":", "return", "0", "if", "any", "(", "[", "LF_CD_DISTANCE_LONG", "(", "c", ")", ",", "LF_CD_DISTANCE_SHORT", "(", "c", ")", "]", ")", "else", "1" ]
This LF is designed to make sure that the compound mention and the gene mention are in an acceptable distance between each other
[ "This", "LF", "is", "designed", "to", "make", "sure", "that", "the", "compound", "mention", "and", "the", "gene", "mention", "are", "in", "an", "acceptable", "distance", "between", "each", "other" ]
[ "\"\"\"\n This LF is designed to make sure that the compound mention\n and the gene mention are in an acceptable distance between \n each other\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
632f68101e917b3144c8b44add82507d0cfe429f
ajlee21/snorkeling
compound_disease/compound_treats_disease/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_BICLUSTER_TREATMENT
<not_specific>
def LF_CD_BICLUSTER_TREATMENT(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = int(c.get_parent().document.name) if (pubmed_id, sen_pos) in treatment_base: return 1 r...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_CD_BICLUSTER_TREATMENT(c): sen_pos = c.get_parent().position pubmed_id = int(c.get_parent().document.name) if (pubmed_id, sen_pos) in treatment_base: return 1 return 0
[ "def", "LF_CD_BICLUSTER_TREATMENT", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "int", "(", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", ")", "if", "(", "pubmed_id", ",", ...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
632f68101e917b3144c8b44add82507d0cfe429f
ajlee21/snorkeling
compound_disease/compound_treats_disease/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_BICLUSTER_INHIBITS
<not_specific>
def LF_CD_BICLUSTER_INHIBITS(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = int(c.get_parent().document.name) if (pubmed_id, sen_pos) in inhibits_base: return 1 ret...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_CD_BICLUSTER_INHIBITS(c): sen_pos = c.get_parent().position pubmed_id = int(c.get_parent().document.name) if (pubmed_id, sen_pos) in inhibits_base: return 1 return 0
[ "def", "LF_CD_BICLUSTER_INHIBITS", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "int", "(", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", ")", "if", "(", "pubmed_id", ",", ...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
632f68101e917b3144c8b44add82507d0cfe429f
ajlee21/snorkeling
compound_disease/compound_treats_disease/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_BICLUSTER_SIDE_EFFECT
<not_specific>
def LF_CD_BICLUSTER_SIDE_EFFECT(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = int(c.get_parent().document.name) if (pubmed_id, sen_pos) in side_effect_base: return 1 ...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_CD_BICLUSTER_SIDE_EFFECT(c): sen_pos = c.get_parent().position pubmed_id = int(c.get_parent().document.name) if (pubmed_id, sen_pos) in side_effect_base: return 1 return 0
[ "def", "LF_CD_BICLUSTER_SIDE_EFFECT", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "int", "(", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", ")", "if", "(", "pubmed_id", ",",...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
632f68101e917b3144c8b44add82507d0cfe429f
ajlee21/snorkeling
compound_disease/compound_treats_disease/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_BICLUSTER_PREVENTS
<not_specific>
def LF_CD_BICLUSTER_PREVENTS(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = int(c.get_parent().document.name) if (pubmed_id, sen_pos) in prevents_base: return 1 ret...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_CD_BICLUSTER_PREVENTS(c): sen_pos = c.get_parent().position pubmed_id = int(c.get_parent().document.name) if (pubmed_id, sen_pos) in prevents_base: return 1 return 0
[ "def", "LF_CD_BICLUSTER_PREVENTS", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "int", "(", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", ")", "if", "(", "pubmed_id", ",", ...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
632f68101e917b3144c8b44add82507d0cfe429f
ajlee21/snorkeling
compound_disease/compound_treats_disease/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_BICLUSTER_ALLEVIATES
<not_specific>
def LF_CD_BICLUSTER_ALLEVIATES(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = int(c.get_parent().document.name) if (pubmed_id, sen_pos) in alleviates_base: return 1 ...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_CD_BICLUSTER_ALLEVIATES(c): sen_pos = c.get_parent().position pubmed_id = int(c.get_parent().document.name) if (pubmed_id, sen_pos) in alleviates_base: return 1 return 0
[ "def", "LF_CD_BICLUSTER_ALLEVIATES", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "int", "(", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", ")", "if", "(", "pubmed_id", ",", ...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
632f68101e917b3144c8b44add82507d0cfe429f
ajlee21/snorkeling
compound_disease/compound_treats_disease/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_BICLUSTER_DISEASE_ROLE
<not_specific>
def LF_CD_BICLUSTER_DISEASE_ROLE(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = int(c.get_parent().document.name) if (pubmed_id, sen_pos) in disease_role_base: return 1...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_CD_BICLUSTER_DISEASE_ROLE(c): sen_pos = c.get_parent().position pubmed_id = int(c.get_parent().document.name) if (pubmed_id, sen_pos) in disease_role_base: return 1 return 0
[ "def", "LF_CD_BICLUSTER_DISEASE_ROLE", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "int", "(", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", ")", "if", "(", "pubmed_id", ","...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
632f68101e917b3144c8b44add82507d0cfe429f
ajlee21/snorkeling
compound_disease/compound_treats_disease/data/label_functions/compound_disease_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CD_BICLUSTER_BIOMARKERS
<not_specific>
def LF_CD_BICLUSTER_BIOMARKERS(c): """ This label function uses the bicluster data located in the A global network of biomedical relationships """ sen_pos = c.get_parent().position pubmed_id = int(c.get_parent().document.name) if (pubmed_id, sen_pos) in biomarkers_base: return 1 ...
This label function uses the bicluster data located in the A global network of biomedical relationships
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
def LF_CD_BICLUSTER_BIOMARKERS(c): sen_pos = c.get_parent().position pubmed_id = int(c.get_parent().document.name) if (pubmed_id, sen_pos) in biomarkers_base: return 1 return 0
[ "def", "LF_CD_BICLUSTER_BIOMARKERS", "(", "c", ")", ":", "sen_pos", "=", "c", ".", "get_parent", "(", ")", ".", "position", "pubmed_id", "=", "int", "(", "c", ".", "get_parent", "(", ")", ".", "document", ".", "name", ")", "if", "(", "pubmed_id", ",", ...
This label function uses the bicluster data located in the A global network of biomedical relationships
[ "This", "label", "function", "uses", "the", "bicluster", "data", "located", "in", "the", "A", "global", "network", "of", "biomedical", "relationships" ]
[ "\"\"\"\n This label function uses the bicluster data located in the \n A global network of biomedical relationships\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
498b6146498b27a03a9b99a273680b7852cf674f
ajlee21/snorkeling
modules/utils/notebook_utils/doc2vec_helper.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
write_sentences_to_file
<not_specific>
def write_sentences_to_file(candidate_obj_dict, sentences_file_dict): """ This function is designed to get candiadte objects from the postgres database candidate_obj_dict - a dictionary containing candidates objects sentences_file_dict - a dictionary containing directories to write each file to. ""...
This function is designed to get candiadte objects from the postgres database candidate_obj_dict - a dictionary containing candidates objects sentences_file_dict - a dictionary containing directories to write each file to.
This function is designed to get candiadte objects from the postgres database candidate_obj_dict - a dictionary containing candidates objects sentences_file_dict - a dictionary containing directories to write each file to.
[ "This", "function", "is", "designed", "to", "get", "candiadte", "objects", "from", "the", "postgres", "database", "candidate_obj_dict", "-", "a", "dictionary", "containing", "candidates", "objects", "sentences_file_dict", "-", "a", "dictionary", "containing", "directo...
def write_sentences_to_file(candidate_obj_dict, sentences_file_dict): for key in candidate_obj_dict: with open(sentences_file_dict[key], 'w') as f: for candidate in candidate_obj_dict[key]: f.write(candidate.get_parent().text + "\n") return
[ "def", "write_sentences_to_file", "(", "candidate_obj_dict", ",", "sentences_file_dict", ")", ":", "for", "key", "in", "candidate_obj_dict", ":", "with", "open", "(", "sentences_file_dict", "[", "key", "]", ",", "'w'", ")", "as", "f", ":", "for", "candidate", ...
This function is designed to get candiadte objects from the postgres database candidate_obj_dict - a dictionary containing candidates objects sentences_file_dict - a dictionary containing directories to write each file to.
[ "This", "function", "is", "designed", "to", "get", "candiadte", "objects", "from", "the", "postgres", "database", "candidate_obj_dict", "-", "a", "dictionary", "containing", "candidates", "objects", "sentences_file_dict", "-", "a", "dictionary", "containing", "directo...
[ "\"\"\"\n This function is designed to get candiadte objects from the postgres database\n\n candidate_obj_dict - a dictionary containing candidates objects\n sentences_file_dict - a dictionary containing directories to write each file to.\n \"\"\"" ]
[ { "param": "candidate_obj_dict", "type": null }, { "param": "sentences_file_dict", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "candidate_obj_dict", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "sentences_file_dict", "type": null, "docstring": null...
498b6146498b27a03a9b99a273680b7852cf674f
ajlee21/snorkeling
modules/utils/notebook_utils/doc2vec_helper.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
execute_doc2vec
<not_specific>
def execute_doc2vec(training_file, word_file, output_file, test_file, vocab_file, read_vocab=False): """ This function is designed run doc2vec to embed sentences into dense vectors. training_file - a file path that contains training sentences used for embeddings word_file - a file path that tells doc2v...
This function is designed run doc2vec to embed sentences into dense vectors. training_file - a file path that contains training sentences used for embeddings word_file - a file path that tells doc2vec where to output word vectors output_file - a file path that tells doc2vec where to output doc vectors...
This function is designed run doc2vec to embed sentences into dense vectors.
[ "This", "function", "is", "designed", "run", "doc2vec", "to", "embed", "sentences", "into", "dense", "vectors", "." ]
def execute_doc2vec(training_file, word_file, output_file, test_file, vocab_file, read_vocab=False): command = [ '../../../iclr2017/doc2vecc', '-train', training_file, '-word', word_file, '-output', output_file, '-cbow', '1', '-size', '500', '-negative', '5', '-hs', '0', '-thread...
[ "def", "execute_doc2vec", "(", "training_file", ",", "word_file", ",", "output_file", ",", "test_file", ",", "vocab_file", ",", "read_vocab", "=", "False", ")", ":", "command", "=", "[", "'../../../iclr2017/doc2vecc'", ",", "'-train'", ",", "training_file", ",", ...
This function is designed run doc2vec to embed sentences into dense vectors.
[ "This", "function", "is", "designed", "run", "doc2vec", "to", "embed", "sentences", "into", "dense", "vectors", "." ]
[ "\"\"\"\n This function is designed run doc2vec to embed sentences into dense vectors.\n\n training_file - a file path that contains training sentences used for embeddings\n word_file - a file path that tells doc2vec where to output word vectors\n output_file - a file path that tells doc2vec where to ou...
[ { "param": "training_file", "type": null }, { "param": "word_file", "type": null }, { "param": "output_file", "type": null }, { "param": "test_file", "type": null }, { "param": "vocab_file", "type": null }, { "param": "read_vocab", "type": null }...
{ "returns": [], "raises": [], "params": [ { "identifier": "training_file", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "word_file", "type": null, "docstring": null, "docstr...
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_HETNET_DRUGBANK
<not_specific>
def LF_HETNET_DRUGBANK(c): """ This label function returns 1 if the given Disease Gene pair is located in the Drugbank database """ return 1 if (c.Gene_cid, c.Compound_cid, "DrugBank") in knowledge_base else 0
This label function returns 1 if the given Disease Gene pair is located in the Drugbank database
This label function returns 1 if the given Disease Gene pair is located in the Drugbank database
[ "This", "label", "function", "returns", "1", "if", "the", "given", "Disease", "Gene", "pair", "is", "located", "in", "the", "Drugbank", "database" ]
def LF_HETNET_DRUGBANK(c): return 1 if (c.Gene_cid, c.Compound_cid, "DrugBank") in knowledge_base else 0
[ "def", "LF_HETNET_DRUGBANK", "(", "c", ")", ":", "return", "1", "if", "(", "c", ".", "Gene_cid", ",", "c", ".", "Compound_cid", ",", "\"DrugBank\"", ")", "in", "knowledge_base", "else", "0" ]
This label function returns 1 if the given Disease Gene pair is located in the Drugbank database
[ "This", "label", "function", "returns", "1", "if", "the", "given", "Disease", "Gene", "pair", "is", "located", "in", "the", "Drugbank", "database" ]
[ "\"\"\"\n This label function returns 1 if the given Disease Gene pair is\n located in the Drugbank database\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_HETNET_DRUGCENTRAL
<not_specific>
def LF_HETNET_DRUGCENTRAL(c): """ This label function returns 1 if the given Disease Gene pair is located in the Drugcentral database """ return 1 if (c.Gene_cid, c.Compound_cid, "DrugCentral") in knowledge_base else 0
This label function returns 1 if the given Disease Gene pair is located in the Drugcentral database
This label function returns 1 if the given Disease Gene pair is located in the Drugcentral database
[ "This", "label", "function", "returns", "1", "if", "the", "given", "Disease", "Gene", "pair", "is", "located", "in", "the", "Drugcentral", "database" ]
def LF_HETNET_DRUGCENTRAL(c): return 1 if (c.Gene_cid, c.Compound_cid, "DrugCentral") in knowledge_base else 0
[ "def", "LF_HETNET_DRUGCENTRAL", "(", "c", ")", ":", "return", "1", "if", "(", "c", ".", "Gene_cid", ",", "c", ".", "Compound_cid", ",", "\"DrugCentral\"", ")", "in", "knowledge_base", "else", "0" ]
This label function returns 1 if the given Disease Gene pair is located in the Drugcentral database
[ "This", "label", "function", "returns", "1", "if", "the", "given", "Disease", "Gene", "pair", "is", "located", "in", "the", "Drugcentral", "database" ]
[ "\"\"\"\n This label function returns 1 if the given Disease Gene pair is\n located in the Drugcentral database\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_HETNET_ChEMBL
<not_specific>
def LF_HETNET_ChEMBL(c): """ This label function returns 1 if the given Disease Gene pair is located in the ChEMBL database """ return 1 if (c.Gene_cid, c.Compound_cid, "ChEMBL") in knowledge_base else 0
This label function returns 1 if the given Disease Gene pair is located in the ChEMBL database
This label function returns 1 if the given Disease Gene pair is located in the ChEMBL database
[ "This", "label", "function", "returns", "1", "if", "the", "given", "Disease", "Gene", "pair", "is", "located", "in", "the", "ChEMBL", "database" ]
def LF_HETNET_ChEMBL(c): return 1 if (c.Gene_cid, c.Compound_cid, "ChEMBL") in knowledge_base else 0
[ "def", "LF_HETNET_ChEMBL", "(", "c", ")", ":", "return", "1", "if", "(", "c", ".", "Gene_cid", ",", "c", ".", "Compound_cid", ",", "\"ChEMBL\"", ")", "in", "knowledge_base", "else", "0" ]
This label function returns 1 if the given Disease Gene pair is located in the ChEMBL database
[ "This", "label", "function", "returns", "1", "if", "the", "given", "Disease", "Gene", "pair", "is", "located", "in", "the", "ChEMBL", "database" ]
[ "\"\"\"\n This label function returns 1 if the given Disease Gene pair is\n located in the ChEMBL database\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_HETNET_BINDINGDB
<not_specific>
def LF_HETNET_BINDINGDB(c): """ This label function returns 1 if the given Disease Gene pair is located in the BindingDB database """ return 1 if (c.Gene_cid, c.Compound_cid, "BindingDB") in knowledge_base else 0
This label function returns 1 if the given Disease Gene pair is located in the BindingDB database
This label function returns 1 if the given Disease Gene pair is located in the BindingDB database
[ "This", "label", "function", "returns", "1", "if", "the", "given", "Disease", "Gene", "pair", "is", "located", "in", "the", "BindingDB", "database" ]
def LF_HETNET_BINDINGDB(c): return 1 if (c.Gene_cid, c.Compound_cid, "BindingDB") in knowledge_base else 0
[ "def", "LF_HETNET_BINDINGDB", "(", "c", ")", ":", "return", "1", "if", "(", "c", ".", "Gene_cid", ",", "c", ".", "Compound_cid", ",", "\"BindingDB\"", ")", "in", "knowledge_base", "else", "0" ]
This label function returns 1 if the given Disease Gene pair is located in the BindingDB database
[ "This", "label", "function", "returns", "1", "if", "the", "given", "Disease", "Gene", "pair", "is", "located", "in", "the", "BindingDB", "database" ]
[ "\"\"\"\n This label function returns 1 if the given Disease Gene pair is\n located in the BindingDB database\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_HETNET_PDSP_KI
<not_specific>
def LF_HETNET_PDSP_KI(c): """ This label function returns 1 if the given Disease Gene pair is located in the PDSP_KI database """ return 1 if (c.Gene_cid, c.Compound_cid, "PDSP Ki") in knowledge_base else 0
This label function returns 1 if the given Disease Gene pair is located in the PDSP_KI database
This label function returns 1 if the given Disease Gene pair is located in the PDSP_KI database
[ "This", "label", "function", "returns", "1", "if", "the", "given", "Disease", "Gene", "pair", "is", "located", "in", "the", "PDSP_KI", "database" ]
def LF_HETNET_PDSP_KI(c): return 1 if (c.Gene_cid, c.Compound_cid, "PDSP Ki") in knowledge_base else 0
[ "def", "LF_HETNET_PDSP_KI", "(", "c", ")", ":", "return", "1", "if", "(", "c", ".", "Gene_cid", ",", "c", ".", "Compound_cid", ",", "\"PDSP Ki\"", ")", "in", "knowledge_base", "else", "0" ]
This label function returns 1 if the given Disease Gene pair is located in the PDSP_KI database
[ "This", "label", "function", "returns", "1", "if", "the", "given", "Disease", "Gene", "pair", "is", "located", "in", "the", "PDSP_KI", "database" ]
[ "\"\"\"\n This label function returns 1 if the given Disease Gene pair is\n located in the PDSP_KI database\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_HETNET_US_PATENT
<not_specific>
def LF_HETNET_US_PATENT(c): """ This label function returns 1 if the given Disease Gene pair is located in the US PATENT database """ return 1 if (c.Gene_cid, c.Compound_cid, "US Patent") in knowledge_base else 0
This label function returns 1 if the given Disease Gene pair is located in the US PATENT database
This label function returns 1 if the given Disease Gene pair is located in the US PATENT database
[ "This", "label", "function", "returns", "1", "if", "the", "given", "Disease", "Gene", "pair", "is", "located", "in", "the", "US", "PATENT", "database" ]
def LF_HETNET_US_PATENT(c): return 1 if (c.Gene_cid, c.Compound_cid, "US Patent") in knowledge_base else 0
[ "def", "LF_HETNET_US_PATENT", "(", "c", ")", ":", "return", "1", "if", "(", "c", ".", "Gene_cid", ",", "c", ".", "Compound_cid", ",", "\"US Patent\"", ")", "in", "knowledge_base", "else", "0" ]
This label function returns 1 if the given Disease Gene pair is located in the US PATENT database
[ "This", "label", "function", "returns", "1", "if", "the", "given", "Disease", "Gene", "pair", "is", "located", "in", "the", "US", "PATENT", "database" ]
[ "\"\"\"\n This label function returns 1 if the given Disease Gene pair is\n located in the US PATENT database\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_HETNET_PUBCHEM
<not_specific>
def LF_HETNET_PUBCHEM(c): """ This label function returns 1 if the given Disease Gene pair is located in the PUBCHEM database """ return 1 if (c.Gene_cid, c.Compound_cid, "PubChem") in knowledge_base else 0
This label function returns 1 if the given Disease Gene pair is located in the PUBCHEM database
This label function returns 1 if the given Disease Gene pair is located in the PUBCHEM database
[ "This", "label", "function", "returns", "1", "if", "the", "given", "Disease", "Gene", "pair", "is", "located", "in", "the", "PUBCHEM", "database" ]
def LF_HETNET_PUBCHEM(c): return 1 if (c.Gene_cid, c.Compound_cid, "PubChem") in knowledge_base else 0
[ "def", "LF_HETNET_PUBCHEM", "(", "c", ")", ":", "return", "1", "if", "(", "c", ".", "Gene_cid", ",", "c", ".", "Compound_cid", ",", "\"PubChem\"", ")", "in", "knowledge_base", "else", "0" ]
This label function returns 1 if the given Disease Gene pair is located in the PUBCHEM database
[ "This", "label", "function", "returns", "1", "if", "the", "given", "Disease", "Gene", "pair", "is", "located", "in", "the", "PUBCHEM", "database" ]
[ "\"\"\"\n This label function returns 1 if the given Disease Gene pair is\n located in the PUBCHEM database\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_HETNET_CG_ABSENT
<not_specific>
def LF_HETNET_CG_ABSENT(c): """ This label function fires -1 if the given Disease Gene pair does not appear in the databases above. """ return 0 if any([ LF_HETNET_DRUGBANK(c), LF_HETNET_DRUGCENTRAL(c), LF_HETNET_ChEMBL(c), LF_HETNET_BINDINGDB(c), LF_HETNET_P...
This label function fires -1 if the given Disease Gene pair does not appear in the databases above.
This label function fires -1 if the given Disease Gene pair does not appear in the databases above.
[ "This", "label", "function", "fires", "-", "1", "if", "the", "given", "Disease", "Gene", "pair", "does", "not", "appear", "in", "the", "databases", "above", "." ]
def LF_HETNET_CG_ABSENT(c): return 0 if any([ LF_HETNET_DRUGBANK(c), LF_HETNET_DRUGCENTRAL(c), LF_HETNET_ChEMBL(c), LF_HETNET_BINDINGDB(c), LF_HETNET_PDSP_KI(c), LF_HETNET_US_PATENT(c), LF_HETNET_PUBCHEM(c) ]) else -1
[ "def", "LF_HETNET_CG_ABSENT", "(", "c", ")", ":", "return", "0", "if", "any", "(", "[", "LF_HETNET_DRUGBANK", "(", "c", ")", ",", "LF_HETNET_DRUGCENTRAL", "(", "c", ")", ",", "LF_HETNET_ChEMBL", "(", "c", ")", ",", "LF_HETNET_BINDINGDB", "(", "c", ")", "...
This label function fires -1 if the given Disease Gene pair does not appear in the databases above.
[ "This", "label", "function", "fires", "-", "1", "if", "the", "given", "Disease", "Gene", "pair", "does", "not", "appear", "in", "the", "databases", "above", "." ]
[ "\"\"\"\n This label function fires -1 if the given Disease Gene pair does not appear \n in the databases above.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CG_CHECK_GENE_TAG
<not_specific>
def LF_CG_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].ge...
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_CG_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(" "): i...
[ "def", "LF_CG_CHECK_GENE_TAG", "(", "c", ")", ":", "sen", "=", "c", "[", "1", "]", ".", "get_parent", "(", ")", "gene_name", "=", "re", ".", "sub", "(", "\"\\)\"", ",", "\"\"", ",", "c", "[", "1", "]", ".", "get_span", "(", ")", ".", "lower", "...
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", "." ]
[ "\"\"\"\n This label function is used for labeling each passed candidate as either pos or neg.\n Keyword Args:\n c- the candidate object to be passed in.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CG_BINDING
<not_specific>
def LF_CG_BINDING(c): """ This label function is designed to look for phrases that imply a compound binding to a gene/protein """ if re.search(ltp(binding_indication), get_text_between(c), flags=re.I): return 1 elif re.search(ltp(binding_indication), " ".join(get_left_tokens(c[0], window...
This label function is designed to look for phrases that imply a compound binding to a gene/protein
This label function is designed to look for phrases that imply a compound binding to a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "imply", "a", "compound", "binding", "to", "a", "gene", "/", "protein" ]
def LF_CG_BINDING(c): if re.search(ltp(binding_indication), get_text_between(c), flags=re.I): return 1 elif re.search(ltp(binding_indication), " ".join(get_left_tokens(c[0], window=5)), flags=re.I): return 1 elif re.search(ltp(binding_indication), " ".join(get_right_tokens(c[0], window=5)), ...
[ "def", "LF_CG_BINDING", "(", "c", ")", ":", "if", "re", ".", "search", "(", "ltp", "(", "binding_indication", ")", ",", "get_text_between", "(", "c", ")", ",", "flags", "=", "re", ".", "I", ")", ":", "return", "1", "elif", "re", ".", "search", "(",...
This label function is designed to look for phrases that imply a compound binding to a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "imply", "a", "compound", "binding", "to", "a", "gene", "/", "protein" ]
[ "\"\"\"\n This label function is designed to look for phrases\n that imply a compound binding to a gene/protein\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CG_WEAK_BINDING
<not_specific>
def LF_CG_WEAK_BINDING(c): """ This label function is designed to look for phrases that could imply a compound binding to a gene/protein """ if re.search(ltp(weak_binding_indications), get_text_between(c), flags=re.I): return 1 else: return 0
This label function is designed to look for phrases that could imply a compound binding to a gene/protein
This label function is designed to look for phrases that could imply a compound binding to a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "could", "imply", "a", "compound", "binding", "to", "a", "gene", "/", "protein" ]
def LF_CG_WEAK_BINDING(c): if re.search(ltp(weak_binding_indications), get_text_between(c), flags=re.I): return 1 else: return 0
[ "def", "LF_CG_WEAK_BINDING", "(", "c", ")", ":", "if", "re", ".", "search", "(", "ltp", "(", "weak_binding_indications", ")", ",", "get_text_between", "(", "c", ")", ",", "flags", "=", "re", ".", "I", ")", ":", "return", "1", "else", ":", "return", "...
This label function is designed to look for phrases that could imply a compound binding to a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "could", "imply", "a", "compound", "binding", "to", "a", "gene", "/", "protein" ]
[ "\"\"\"\n This label function is designed to look for phrases\n that could imply a compound binding to a gene/protein\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CG_UPREGULATES
<not_specific>
def LF_CG_UPREGULATES(c): """ This label function is designed to look for phrases that implies a compound increaseing activity of a gene/protein """ if re.search(ltp(upregulates), get_text_between(c), flags=re.I): return 1 elif upregulates.intersection(get_left_tokens(c[1], window=2)): ...
This label function is designed to look for phrases that implies a compound increaseing activity of a gene/protein
This label function is designed to look for phrases that implies a compound increaseing activity of a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "implies", "a", "compound", "increaseing", "activity", "of", "a", "gene", "/", "protein" ]
def LF_CG_UPREGULATES(c): if re.search(ltp(upregulates), get_text_between(c), flags=re.I): return 1 elif upregulates.intersection(get_left_tokens(c[1], window=2)): return 1 else: return 0
[ "def", "LF_CG_UPREGULATES", "(", "c", ")", ":", "if", "re", ".", "search", "(", "ltp", "(", "upregulates", ")", ",", "get_text_between", "(", "c", ")", ",", "flags", "=", "re", ".", "I", ")", ":", "return", "1", "elif", "upregulates", ".", "intersect...
This label function is designed to look for phrases that implies a compound increaseing activity of a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "implies", "a", "compound", "increaseing", "activity", "of", "a", "gene", "/", "protein" ]
[ "\"\"\"\n This label function is designed to look for phrases\n that implies a compound increaseing activity of a gene/protein\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CG_DOWNREGULATES
<not_specific>
def LF_CG_DOWNREGULATES(c): """ This label function is designed to look for phrases that could implies a compound decreasing the activity of a gene/protein """ if re.search(ltp(downregulates), get_text_between(c), flags=re.I): return 1 elif downregulates.intersection(get_right_tokens(c[1...
This label function is designed to look for phrases that could implies a compound decreasing the activity of a gene/protein
This label function is designed to look for phrases that could implies a compound decreasing the activity of a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "could", "implies", "a", "compound", "decreasing", "the", "activity", "of", "a", "gene", "/", "protein" ]
def LF_CG_DOWNREGULATES(c): if re.search(ltp(downregulates), get_text_between(c), flags=re.I): return 1 elif downregulates.intersection(get_right_tokens(c[1], window=2)): return 1 else: return 0
[ "def", "LF_CG_DOWNREGULATES", "(", "c", ")", ":", "if", "re", ".", "search", "(", "ltp", "(", "downregulates", ")", ",", "get_text_between", "(", "c", ")", ",", "flags", "=", "re", ".", "I", ")", ":", "return", "1", "elif", "downregulates", ".", "int...
This label function is designed to look for phrases that could implies a compound decreasing the activity of a gene/protein
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "could", "implies", "a", "compound", "decreasing", "the", "activity", "of", "a", "gene", "/", "protein" ]
[ "\"\"\"\n This label function is designed to look for phrases\n that could implies a compound decreasing the activity of a gene/protein\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CG_GENE_RECEIVERS
<not_specific>
def LF_CG_GENE_RECEIVERS(c): """ This label function is designed to look for phrases that imples a kinases or sort of protein that receives a stimulus to function """ if re.search(ltp(gene_receivers), " ".join(get_right_tokens(c[1], window=4))) or re.search(ltp(gene_receivers), " ".join(get_left...
This label function is designed to look for phrases that imples a kinases or sort of protein that receives a stimulus to function
This label function is designed to look for phrases that imples a kinases or sort of protein that receives a stimulus to function
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "imples", "a", "kinases", "or", "sort", "of", "protein", "that", "receives", "a", "stimulus", "to", "function" ]
def LF_CG_GENE_RECEIVERS(c): if re.search(ltp(gene_receivers), " ".join(get_right_tokens(c[1], window=4))) or re.search(ltp(gene_receivers), " ".join(get_left_tokens(c[1], window=4))): return 1 elif re.search(ltp(gene_receivers), c[1].get_span(), flags=re.I): return 1 else: return 0
[ "def", "LF_CG_GENE_RECEIVERS", "(", "c", ")", ":", "if", "re", ".", "search", "(", "ltp", "(", "gene_receivers", ")", ",", "\" \"", ".", "join", "(", "get_right_tokens", "(", "c", "[", "1", "]", ",", "window", "=", "4", ")", ")", ")", "or", "re", ...
This label function is designed to look for phrases that imples a kinases or sort of protein that receives a stimulus to function
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "imples", "a", "kinases", "or", "sort", "of", "protein", "that", "receives", "a", "stimulus", "to", "function" ]
[ "\"\"\"\n This label function is designed to look for phrases\n that imples a kinases or sort of protein that receives\n a stimulus to function\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CG_ASE_SUFFIX
<not_specific>
def LF_CG_ASE_SUFFIX(c): """ This label function is designed to look parts of the gene tags that implies a sort of "ase" or enzyme """ if re.search(r"ase\b", c[1].get_span(), flags=re.I): return 1 else: return 0
This label function is designed to look parts of the gene tags that implies a sort of "ase" or enzyme
This label function is designed to look parts of the gene tags that implies a sort of "ase" or enzyme
[ "This", "label", "function", "is", "designed", "to", "look", "parts", "of", "the", "gene", "tags", "that", "implies", "a", "sort", "of", "\"", "ase", "\"", "or", "enzyme" ]
def LF_CG_ASE_SUFFIX(c): if re.search(r"ase\b", c[1].get_span(), flags=re.I): return 1 else: return 0
[ "def", "LF_CG_ASE_SUFFIX", "(", "c", ")", ":", "if", "re", ".", "search", "(", "r\"ase\\b\"", ",", "c", "[", "1", "]", ".", "get_span", "(", ")", ",", "flags", "=", "re", ".", "I", ")", ":", "return", "1", "else", ":", "return", "0" ]
This label function is designed to look parts of the gene tags that implies a sort of "ase" or enzyme
[ "This", "label", "function", "is", "designed", "to", "look", "parts", "of", "the", "gene", "tags", "that", "implies", "a", "sort", "of", "\"", "ase", "\"", "or", "enzyme" ]
[ "\"\"\"\n This label function is designed to look parts of the gene tags\n that implies a sort of \"ase\" or enzyme\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CG_IN_SERIES
<not_specific>
def LF_CG_IN_SERIES(c): """ This label function is designed to look for a mention being caught in a series of other genes or compounds """ if len(re.findall(r',', get_tagged_text(c))) >= 2: if re.search(', and', get_tagged_text(c)): return -1 return 0
This label function is designed to look for a mention being caught in a series of other genes or compounds
This label function is designed to look for a mention being caught in a series of other genes or compounds
[ "This", "label", "function", "is", "designed", "to", "look", "for", "a", "mention", "being", "caught", "in", "a", "series", "of", "other", "genes", "or", "compounds" ]
def LF_CG_IN_SERIES(c): if len(re.findall(r',', get_tagged_text(c))) >= 2: if re.search(', and', get_tagged_text(c)): return -1 return 0
[ "def", "LF_CG_IN_SERIES", "(", "c", ")", ":", "if", "len", "(", "re", ".", "findall", "(", "r','", ",", "get_tagged_text", "(", "c", ")", ")", ")", ">=", "2", ":", "if", "re", ".", "search", "(", "', and'", ",", "get_tagged_text", "(", "c", ")", ...
This label function is designed to look for a mention being caught in a series of other genes or compounds
[ "This", "label", "function", "is", "designed", "to", "look", "for", "a", "mention", "being", "caught", "in", "a", "series", "of", "other", "genes", "or", "compounds" ]
[ "\"\"\"\n This label function is designed to look for a mention being caught\n in a series of other genes or compounds\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CG_ANTIBODY
<not_specific>
def LF_CG_ANTIBODY(c): """ This label function is designed to look for phrase antibody. """ if "antibody" in c[1].get_span() or re.search("antibody", " ".join(get_right_tokens(c[1], window=3))): return 1 elif "antibodies" in c[1].get_span() or re.search("antibodies", " ".join(get_right_t...
This label function is designed to look for phrase antibody.
This label function is designed to look for phrase antibody.
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrase", "antibody", "." ]
def LF_CG_ANTIBODY(c): if "antibody" in c[1].get_span() or re.search("antibody", " ".join(get_right_tokens(c[1], window=3))): return 1 elif "antibodies" in c[1].get_span() or re.search("antibodies", " ".join(get_right_tokens(c[1], window=3))): return 1 else: return 0
[ "def", "LF_CG_ANTIBODY", "(", "c", ")", ":", "if", "\"antibody\"", "in", "c", "[", "1", "]", ".", "get_span", "(", ")", "or", "re", ".", "search", "(", "\"antibody\"", ",", "\" \"", ".", "join", "(", "get_right_tokens", "(", "c", "[", "1", "]", ","...
This label function is designed to look for phrase antibody.
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrase", "antibody", "." ]
[ "\"\"\"\n This label function is designed to look for phrase\n antibody.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CG_METHOD_DESC
<not_specific>
def LF_CG_METHOD_DESC(c): """ This label function is designed to look for phrases that imply a sentence is description an experimental design """ if re.search(ltp(method_indication), get_tagged_text(c), flags=re.I): return -1 else: return 0
This label function is designed to look for phrases that imply a sentence is description an experimental design
This label function is designed to look for phrases that imply a sentence is description an experimental design
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "imply", "a", "sentence", "is", "description", "an", "experimental", "design" ]
def LF_CG_METHOD_DESC(c): if re.search(ltp(method_indication), get_tagged_text(c), flags=re.I): return -1 else: return 0
[ "def", "LF_CG_METHOD_DESC", "(", "c", ")", ":", "if", "re", ".", "search", "(", "ltp", "(", "method_indication", ")", ",", "get_tagged_text", "(", "c", ")", ",", "flags", "=", "re", ".", "I", ")", ":", "return", "-", "1", "else", ":", "return", "0"...
This label function is designed to look for phrases that imply a sentence is description an experimental design
[ "This", "label", "function", "is", "designed", "to", "look", "for", "phrases", "that", "imply", "a", "sentence", "is", "description", "an", "experimental", "design" ]
[ "\"\"\"\n This label function is designed to look for phrases \n that imply a sentence is description an experimental design\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CG_NO_CONCLUSION
<not_specific>
def LF_CG_NO_CONCLUSION(c): """ This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association. """ po...
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association.
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association.
[ "This", "label", "function", "fires", "a", "-", "1", "if", "the", "number", "of", "negative", "label", "functinos", "is", "greater", "than", "the", "number", "of", "positive", "label", "functions", ".", "The", "main", "idea", "behind", "this", "label", "fu...
def LF_CG_NO_CONCLUSION(c): positive_num = np.sum([LF_CG_BINDING(c), LF_CG_WEAK_BINDING(c), LF_CG_GENE_RECEIVERS(c), LF_CG_ANTIBODY(c), LF_CG_UPREGULATES(c), LF_CG_DOWNREGULATES(c)]) negative_num = np.abs(np.sum(LF_CG_METHOD_DESC(c))) if positive_num - negative_num >= 1: return 0 ...
[ "def", "LF_CG_NO_CONCLUSION", "(", "c", ")", ":", "positive_num", "=", "np", ".", "sum", "(", "[", "LF_CG_BINDING", "(", "c", ")", ",", "LF_CG_WEAK_BINDING", "(", "c", ")", ",", "LF_CG_GENE_RECEIVERS", "(", "c", ")", ",", "LF_CG_ANTIBODY", "(", "c", ")",...
This label function fires a -1 if the number of negative label functinos is greater than the number of positive label functions.
[ "This", "label", "function", "fires", "a", "-", "1", "if", "the", "number", "of", "negative", "label", "functinos", "is", "greater", "than", "the", "number", "of", "positive", "label", "functions", "." ]
[ "\"\"\"\n This label function fires a -1 if the number of negative label functinos is greater than the number\n of positive label functions.\n The main idea behind this label function is add support to sentences that could\n mention a possible disease gene association.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CG_CONCLUSION
<not_specific>
def LF_CG_CONCLUSION(c): """ This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association """ if not ...
This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association
This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions. The main idea behind this label function is add support to sentences that could mention a possible disease gene association
[ "This", "label", "function", "fires", "a", "1", "if", "the", "number", "of", "positive", "label", "functions", "is", "greater", "than", "the", "number", "of", "negative", "label", "functions", ".", "The", "main", "idea", "behind", "this", "label", "function"...
def LF_CG_CONCLUSION(c): if not LF_CG_NO_CONCLUSION(c): return 1 else: return 0
[ "def", "LF_CG_CONCLUSION", "(", "c", ")", ":", "if", "not", "LF_CG_NO_CONCLUSION", "(", "c", ")", ":", "return", "1", "else", ":", "return", "0" ]
This label function fires a 1 if the number of positive label functions is greater than the number of negative label functions.
[ "This", "label", "function", "fires", "a", "1", "if", "the", "number", "of", "positive", "label", "functions", "is", "greater", "than", "the", "number", "of", "negative", "label", "functions", "." ]
[ "\"\"\"\n This label function fires a 1 if the number of positive label functions is greater than the number\n of negative label functions.\n The main idea behind this label function is add support to sentences that could\n mention a possible disease gene association\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ae2086908c37946bf640a0565011053391bf202e
ajlee21/snorkeling
playground/compound_disease/transfer_learning_experiment/data/label_functions/compound_gene_lf.py
[ "CC0-1.0", "BSD-3-Clause" ]
Python
LF_CG_DISTANCE_SHORT
<not_specific>
def LF_CG_DISTANCE_SHORT(c): """ This LF is designed to make sure that the compound mention and the gene mention aren't right next to each other. """ return -1 if len(list(get_between_tokens(c))) <= 2 else 0
This LF is designed to make sure that the compound mention and the gene mention aren't right next to each other.
This LF is designed to make sure that the compound mention and the gene mention aren't right next to each other.
[ "This", "LF", "is", "designed", "to", "make", "sure", "that", "the", "compound", "mention", "and", "the", "gene", "mention", "aren", "'", "t", "right", "next", "to", "each", "other", "." ]
def LF_CG_DISTANCE_SHORT(c): return -1 if len(list(get_between_tokens(c))) <= 2 else 0
[ "def", "LF_CG_DISTANCE_SHORT", "(", "c", ")", ":", "return", "-", "1", "if", "len", "(", "list", "(", "get_between_tokens", "(", "c", ")", ")", ")", "<=", "2", "else", "0" ]
This LF is designed to make sure that the compound mention and the gene mention aren't right next to each other.
[ "This", "LF", "is", "designed", "to", "make", "sure", "that", "the", "compound", "mention", "and", "the", "gene", "mention", "aren", "'", "t", "right", "next", "to", "each", "other", "." ]
[ "\"\"\"\n This LF is designed to make sure that the compound mention\n and the gene mention aren't right next to each other.\n \"\"\"" ]
[ { "param": "c", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }