Skip to content

Commit

Permalink
Merge pull request #495 from NCATSTranslator/removeAppraise
Browse files Browse the repository at this point in the history
Removing calls to appraise and scoring
  • Loading branch information
ShervinAbd92 authored Sep 1, 2023
2 parents 613bdcf + 40987d0 commit a0d7414
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions tr_sys/tr_ars/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,42 +538,42 @@ def post_process(data,key, agent_name):
scrub_null_attributes(data)
except Exception as e:
logging.info("Problem with the second scrubbing of null attributes")
try:
appraise(mesg,data,agent_name)
logging.info("appraiser successful")
except Exception as e:
code = 422
results = get_safe(data,"message","results")
default_ordering_component = {
"novelty": 0,
"confidence": 0,
"clinical_evidence": 0
}
if results is not None:
for result in results:
if 'ordering_components' not in result.keys():
result['ordering_components']=default_ordering_component
else:
continue
else:
logging.error('results returned from appraiser is None')

#post_processing_error(mesg,data,"Error in appraiser")
logging.error("Error with appraise for "+str(key))
logging.exception("Error in appraiser post process function")
#raise e
try:
results = get_safe(data,"message","results")
if results is not None:
new_res=scoring.compute_from_results(results)
logging.info("scoring succeeded")
else:
logging.error('results from appraiser returns None, cant do the scoring')
print()
except Exception as e:
post_processing_error(mesg,data,"Error in f-score calculation")
logging.exception("Error in f-score calculation")
raise e
# try:
# appraise(mesg,data,agent_name)
# logging.info("appraiser successful")
# except Exception as e:
# code = 422
# results = get_safe(data,"message","results")
# default_ordering_component = {
# "novelty": 0,
# "confidence": 0,
# "clinical_evidence": 0
# }
# if results is not None:
# for result in results:
# if 'ordering_components' not in result.keys():
# result['ordering_components']=default_ordering_component
# else:
# continue
# else:
# logging.error('results returned from appraiser is None')
#
# #post_processing_error(mesg,data,"Error in appraiser")
# logging.error("Error with appraise for "+str(key))
# logging.exception("Error in appraiser post process function")
# #raise e
# try:
# results = get_safe(data,"message","results")
# if results is not None:
# new_res=scoring.compute_from_results(results)
# logging.info("scoring succeeded")
# else:
# logging.error('results from appraiser returns None, cant do the scoring')
# print()
# except Exception as e:
# post_processing_error(mesg,data,"Error in f-score calculation")
# logging.exception("Error in f-score calculation")
# raise e
mesg.status='D'
mesg.code=code
mesg.data = data
Expand Down

0 comments on commit a0d7414

Please sign in to comment.