Skip to content

Commit

Permalink
fix error if CUI does not exist as attribute of concept
Browse files Browse the repository at this point in the history
  • Loading branch information
alistairewj committed Sep 28, 2018
1 parent 267ef78 commit 1a42a1c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions negbio/pipeline/dner_mm.py
Expand Up @@ -68,8 +68,11 @@ def run_metamap_col(collection, mm, cuis=None):
for concept in concepts:
concept_index = adapt_concept_index(concept.index)
try:
if cuis is not None and concept.cui not in cuis:
continue
if cuis is not None:
# if no CUI is returned for this concept - skip it
concept_cui = getattr(concept, 'cui', None)
if concept_cui not in cuis:
continue
m = re.match(r'(\d+)/(\d+)', concept.pos_info)
if m:
passage = sentence_map[concept_index][0]
Expand Down

0 comments on commit 1a42a1c

Please sign in to comment.