Skip to content

Commit

Permalink
Merge pull request #22 from yfpeng/v2
Browse files Browse the repository at this point in the history
v0.9.4
  • Loading branch information
Yifan Peng authored Feb 20, 2019
2 parents 7a2be81 + 16cd936 commit ac0f818
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 9 deletions.
1 change: 0 additions & 1 deletion environment2.7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ dependencies:
- ply=3.10
- tqdm=4.19.5
- nltk=3.2.4
- pytest=3.1.3
- pathlib2=2.3.3
- numpy=1.15.4
- jpype1=0.6.3
Expand Down
21 changes: 21 additions & 0 deletions environment3.7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: negbio3.7
channels:
- anaconda
- conda-forge
- auto
dependencies:
- python=3.7
- docutils=0.14
- docopt=0.6.2
- pytest=4.2.0
- networkx=2.2
- ply=3.11
- tqdm=4.31
- nltk=3.4
- numpy=1.16
- jpype1=0.6.3
- pip:
- bioc==1.3.1
- pystanforddependencies==0.3.1
- bllipparser==2016.9.11
- pymetamap==0.1
10 changes: 6 additions & 4 deletions negbio/pipeline/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ def clean_sentences(document, sort_anns=False):
try:
for passage in document.passages:
del passage.sentences[:]
if sort_anns:
id = 0
for ann in sorted(passage.annotations, key=lambda ann: ann.get_total_location().offset):

if sort_anns:
key_func = lambda ann: ann.get_total_location().offset
id = 0
for passage in document.passages:
for ann in sorted(passage.annotations, key=key_func):
ann.id = str(id)
id += 1
except:
logging.exception("Cannot process %s", document.id)
return document

1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ networkx==1.11
ply==3.10
tqdm==4.19.5
nltk==3.2.4
pytest==3.1.3
bioc==1.1.dev3
pystanforddependencies==0.3.1
bllipparser==2016.9.11
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def run(self):
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.9.3',
version='0.9.4',

description='NegBio: a tool for negation and uncertainty detection',
long_description=readme(),
Expand Down
4 changes: 2 additions & 2 deletions tests/negbio/pipeline/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
from negbio.pipeline.parse import Bllip


def test_parse():
def test_Bllip():
b = Bllip()
t = b.parse('hello world!')
assert str(t) == '(S1 (S (NP (NN hello) (NN world) (NN !))))'


if __name__ == '__main__':
logging.basicConfig(level=logging.WARNING)
test_parse()
test_Bllip()
File renamed without changes.

0 comments on commit ac0f818

Please sign in to comment.