stanfordmlgroup / chexpert-labeler

CheXpert NLP tool to extract observations from radiology reports.
MIT License
340 stars 79 forks source link

Error - ValueError: Parser model has not been loaded. #40

Open njan-creative opened 1 year ago

njan-creative commented 1 year ago

I am getting the below error, when running the label.py

  File "/home/user/anaconda3/envs/chexpert-label/lib/python3.6/site-packages/bllipparser/RerankingParser.py", line 786, in check_models_loaded_or_error
    raise ValueError("Parser model has not been loaded.")
ValueError: Parser model has not been loaded.

I have already downloaded the stanford-core-nlp jar and the bz2 file for the below.

from bllipparser import RerankingParser
RerankingParser.fetch_and_load('GENIA+PubMed')
jirvin16 commented 1 year ago

Sorry that you're having trouble. Can you please share the output of this: RerankingParser.fetch_and_load('GENIA+PubMed', verbose=True)

njan-creative commented 1 year ago

Please find the output below.

Model directory: /home/user/.local/share/bllipparser/GENIA+PubMed
Model directory already exists, not reinstalling

RerankingParser(unified_model_dir='/home/user/.local/share/bllipparser/GENIA+PubMed')

jirvin16 commented 1 year ago

Could you share the entire output (with the full traceback)?

njan-creative commented 1 year ago

Traceback (most recent call last): File "label.py", line 53, in <module> label(parser.parse_args()) File "label.py", line 44, in label classifier.classify(loader.collection) File "/DATA/njan/medical/chexpert/chexpert-labeler/stages/classify.py", line 100, in classify self.parser.parse_doc(document) File "/home/user/.local/lib/python3.7/site-packages/negbio/pipeline/parse.py", line 55, in parse_doc tree = self.parse(text) File "/home/user/.local/lib/python3.7/site-packages/negbio/pipeline/parse.py", line 34, in parse nbest = self.rrp.parse(str(s)) File "/home/njan/anaconda3/envs/negbio3.7/lib/python3.7/site-packages/bllipparser/RerankingParser.py", line 614, in parse rerank = self.check_models_loaded_or_error(rerank) File "/home/njan/anaconda3/envs/negbio3.7/lib/python3.7/site-packages/bllipparser/RerankingParser.py", line 786, in check_models_loaded_or_error raise ValueError("Parser model has not been loaded.") ValueError: Parser model has not been loaded.

njan-creative commented 1 year ago

Traceback (most recent call last): File "label.py", line 53, in label(parser.parse_args()) File "label.py", line 44, in label classifier.classify(loader.collection) File "/DATA/njan/medical/chexpert/chexpert-labeler/stages/classify.py", line 100, in classify self.parser.parse_doc(document) File "/home/user/.local/lib/python3.7/site-packages/negbio/pipeline/parse.py", line 55, in parse_doc tree = self.parse(text) File "/home/user/.local/lib/python3.7/site-packages/negbio/pipeline/parse.py", line 34, in parse nbest = self.rrp.parse(str(s)) File "/home/njan/anaconda3/envs/negbio3.7/lib/python3.7/site-packages/bllipparser/RerankingParser.py", line 614, in parse rerank = self.check_models_loaded_or_error(rerank) File "/home/njan/anaconda3/envs/negbio3.7/lib/python3.7/site-packages/bllipparser/RerankingParser.py", line 786, in check_models_loaded_or_error raise ValueError("Parser model has not been loaded.") ValueError: Parser model has not been loaded.

jirvin16 commented 1 year ago

Perhaps try uninstalling and reinstalling the parser?

The error being thrown is here, so you could try to debug by looking through that file (specifically starting with this method).

Szh2620 commented 5 months ago

hi,i met the same question with you,do you solve it?