Skip to content
This repository has been archived by the owner on Aug 15, 2020. It is now read-only.

Commit

Permalink
made i2b2 2010 data edits more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
wboag committed Apr 10, 2018
1 parent ec828a8 commit 7dc0410
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions code/notes/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,15 @@ def read_i2b2(txt, con):
c2 = tok_concepts[i+1]
if c1[1] == c2[1]:
if c1[2] <= c2[2] and c2[2] <= c1[3]:
fname = os.path.basenme(con)
fname = os.path.basename(con)
error1='%s has overlapping entities on line %d'%(fname,c1[1])
error2="It can't be processed until you remove one"
error_msg = '%s\n%s' % (error1,error2)
error3='Please modify this file: %s' % con
error4='\tentity 1: c="%s" %d:%d %d:%d||t="%s"'%(' '.join(tokenized_sents[c1[1]-1][c1[2]:c1[3]+1]),
c1[1], c1[2], c1[1], c1[3], c1[0])
error5='\tentity 2: c="%s" %d:%d %d:%d||t="%s"'%(' '.join(tokenized_sents[c2[1]-1][c2[2]:c2[3]+1]),
c2[1], c2[2], c2[1], c2[3], c2[0])
error_msg = '\n\n%s\n%s\n\n%s\n\n%s\n%s\n' % (error1,error2,error3,error4,error5)
raise DocumentException(error_msg)

return tokenized_sents, tok_concepts
Expand Down

0 comments on commit 7dc0410

Please sign in to comment.