Skip to content

Commit

Permalink
treats
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Bizon committed Jan 23, 2023
1 parent a66a02c commit f4c8ab8
Show file tree
Hide file tree
Showing 4 changed files with 2,473 additions and 4,970 deletions.
5 changes: 3 additions & 2 deletions src/rules/parse_to_trapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ def parse_line(line, header, source, rule_conf, qmap):
if float(rule["Std Confidence"]) <= minconf:
return {}
# Is the rule going to bring back too many results?
maxbody = source.get("max_body_size", 99999999999)
if int(rule["Body size"]) >= maxbody:
maxnegs = source.get("max_negative_examples", 99999999999)
negatives = int(rule["Body size"]) - int(rule["Positive Examples"])
if int(negatives) >= maxnegs:
return {}
template = rule_to_trapi(rule['Rule'],rule_conf,qmap)
if template is not None:
Expand Down
6 changes: 3 additions & 3 deletions src/rules/rule_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"AMIE_inputs": [
{
"input_file": "robokop_biolink3_fixed_treats_len3_correct_rules.txt",
"min_positive_example": 2000,
"min_std_confidence": 0.001,
"max_body_size": 100000
"min_positive_example": 1000,
"min_std_confidence": 0.01,
"max_negative_examples": 10000
}
],
"source": "biolink:ChemicalEntity",
Expand Down
Loading

0 comments on commit f4c8ab8

Please sign in to comment.