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

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

Open
njan-creative opened this issue Dec 18, 2022 · 7 comments
Open

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

njan-creative opened this issue Dec 18, 2022 · 7 comments

Comments

@njan-creative
Copy link

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
Copy link
Contributor

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

@njan-creative
Copy link
Author

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
Copy link
Contributor

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

@njan-creative
Copy link
Author

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
Copy link
Author

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
Copy link
Contributor

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
Copy link

Szh2620 commented Apr 12, 2024

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

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

3 participants