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

strange error occur, when I run python negbio/main_chexpert.py text --output=examples/test.neg.xml examples/00019248.txt examples/00000086.txt #48

Open
bliu62 opened this issue Mar 31, 2022 · 1 comment

Comments

@bliu62
Copy link

bliu62 commented Mar 31, 2022

{'--bllip-model': '~/.local/share/bllipparser/GENIA+PubMed',
'--mention_phrases_dir': 'negbio/chexpert/phrases/mention',
'--neg-patterns': 'negbio/chexpert/patterns/negation.txt',
'--newline_is_sentence_break': False,
'--output': 'examples/test.neg.xml',
'--post-negation-uncertainty-patterns': 'negbio/chexpert/patterns/post_negation_uncertainty.txt',
'--pre-negation-uncertainty-patterns': 'negbio/chexpert/patterns/pre_negation_uncertainty.txt',
'--split-document': False,
'--unmention_phrases_dir': 'negbio/chexpert/phrases/unmention',
'--verbose': False,
'SOURCE': None,
'SOURCES': ['examples/00019248.txt', 'examples/00000086.txt'],
'bioc': False,
'text': True}
/home/bo/.local/lib/python3.6/site-packages
/home/bo/.local/lib/python3.6/site-packages
/home/bo/.local/lib/python3.6/site-packages
/home/bo/.local/lib/python3.6/site-packages
/home/bo/.local/lib/python3.6/site-packages
/home/bo/conda/envs/negbio/lib/python3.6/site-packages/StanfordDependencies/JPypeBackend.py:160: UserWarning: This jar doesn't support universal dependencies, falling back to Stanford Dependencies. To suppress this message, call with universal=False
warnings.warn("This jar doesn't support universal "
ERROR:root:Cannot process sentence 0 in 00019248
Traceback (most recent call last):
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 120, in convert_doc
has_lemmas=self._backend == 'jpype')
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 171, in convert_dg
index = text.find(node_form, start)
TypeError: must be str, not java.lang.String
ERROR:root:Cannot process sentence 72 in 00019248
Traceback (most recent call last):
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 120, in convert_doc
has_lemmas=self._backend == 'jpype')
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 171, in convert_dg
index = text.find(node_form, start)
TypeError: must be str, not java.lang.String
ERROR:root:Cannot process sentence 123 in 00019248
Traceback (most recent call last):
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 120, in convert_doc
has_lemmas=self._backend == 'jpype')
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 171, in convert_dg
index = text.find(node_form, start)
TypeError: must be str, not java.lang.String
ERROR:root:Cannot process sentence 142 in 00019248
Traceback (most recent call last):
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 120, in convert_doc
has_lemmas=self._backend == 'jpype')
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 171, in convert_dg
index = text.find(node_form, start)
TypeError: must be str, not java.lang.String
ERROR:root:Cannot process sentence 201 in 00019248
Traceback (most recent call last):
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 120, in convert_doc
has_lemmas=self._backend == 'jpype')
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 171, in convert_dg
index = text.find(node_form, start)
TypeError: must be str, not java.lang.String
ERROR:root:Cannot process sentence 0 in 00000086
Traceback (most recent call last):
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 120, in convert_doc
has_lemmas=self._backend == 'jpype')
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 171, in convert_dg
index = text.find(node_form, start)
TypeError: must be str, not java.lang.String
ERROR:root:Cannot process sentence 73 in 00000086
Traceback (most recent call last):
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 120, in convert_doc
has_lemmas=self._backend == 'jpype')
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 171, in convert_dg
index = text.find(node_form, start)
TypeError: must be str, not java.lang.String
ERROR:root:Cannot process sentence 94 in 00000086
Traceback (most recent call last):
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 120, in convert_doc
has_lemmas=self._backend == 'jpype')
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 171, in convert_dg
index = text.find(node_form, start)
TypeError: must be str, not java.lang.String
ERROR:root:Cannot process sentence 122 in 00000086
Traceback (most recent call last):
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 120, in convert_doc
has_lemmas=self._backend == 'jpype')
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 171, in convert_dg
index = text.find(node_form, start)
TypeError: must be str, not java.lang.String
ERROR:root:Cannot process sentence 139 in 00000086
Traceback (most recent call last):
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 120, in convert_doc
has_lemmas=self._backend == 'jpype')
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 171, in convert_dg
index = text.find(node_form, start)
TypeError: must be str, not java.lang.String
ERROR:root:Cannot process sentence 204 in 00000086
Traceback (most recent call last):
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 120, in convert_doc
has_lemmas=self._backend == 'jpype')
File "/home/bo/.local/lib/python3.6/site-packages/negbio/pipeline/ptb2ud.py", line 171, in convert_dg
index = text.find(node_form, start)
TypeError: must be str, not java.lang.String

@karanbajaj
Copy link

I ran in to the same thing -
I am not a python programmer - But here is my explanation. I think it's the python version issue. After googling and stack overflow it seems that the java objects have to be casted with str().
I have made a few changes on my fork to make it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants