Skip to content

Commit

Permalink
CU-2e77aae: Add some logger debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
tomolopolis committed Sep 3, 2024
1 parent 46cee6e commit c3dc40d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions webapp/api/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def check_ents(ent):
tkns_in.append(tkn)
ents.append(ent)

logger.debug('Found %s annotations to store', len(ents))
for ent in ents:
label = ent._.cui

Expand Down Expand Up @@ -103,6 +104,7 @@ def check_ents(ent):

ann_ent.save()

logger.debug('Found % annotations to store', len(ents))
# check the ent._.meta_anns if it exists
if hasattr(ent._, 'meta_anns') and len(metatask2obj) > 0 and len(metataskvals2obj) > 0:
for meta_ann_task, pred in ent._.meta_anns.items():
Expand All @@ -116,6 +118,8 @@ def check_ents(ent):
meta_anno_obj.meta_task_value = metataskvals2obj[meta_ann_task][pred['value']]
meta_anno_obj.acc = pred['confidence']
meta_anno_obj.save()
logger.debug('Successfully saved %s', meta_anno_obj)



def get_create_cdb_infos(cdb, concept, cui, cui_info_prop, code_prop, desc_prop, model_clazz):
Expand Down
1 change: 1 addition & 0 deletions webapp/api/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ def prepare_documents(request):
if (len(anns) == 0 and not is_validated) or update:
# Based on the project id get the right medcat
cat = get_medcat(project=project)
logger.info('loaded medcat model for project: %s', project.id)

# Set CAT filters
cat.config.linking['filters']['cuis'] = cuis
Expand Down

0 comments on commit c3dc40d

Please sign in to comment.