Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing calls to appraise and scoring #495

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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