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

Missing entry point #3

Closed
srmeier opened this issue Mar 14, 2021 · 5 comments
Closed

Missing entry point #3

srmeier opened this issue Mar 14, 2021 · 5 comments

Comments

@srmeier
Copy link

srmeier commented Mar 14, 2021

Attempting to try out the example template via below:

docker run -it --entrypoint=/bin/bash -p 5000:5000 asreview/asreview
cd ~
curl https://raw.githubusercontent.com/asreview/systematic-review-datasets/master/datasets/Bos_2018/output/Bos_2018.csv -o Bos_2018.csv
git clone https://github.com/asreview/template-extension-new-model.git
cd template-extension-new-model/
pip install .
cd ..
asreview simulate Bos_2018.csv -m nb_example

Running into the following error:

            _____ _____            _
     /\    / ____|  __ \          (_)
    /  \  | (___ | |__) |_____   ___  _____      __
   / /\ \  \___ \|  _  // _ \ \ / / |/ _ \ \ /\ / /
  / ____ \ ____) | | \ \  __/\ V /| |  __/\ V  V /
 /_/    \_\_____/|_|  \_\___| \_/ |_|\___| \_/\_/

---------------------------------------------------------------------------------
|                                                                                |
|  Welcome to the ASReview Automated Systematic Review software.                 |
|  In this mode the computer will simulate how well the ASReview software        |
|  could have accelerate the systematic review of your dataset.                  |
|  You can sit back and relax while the computer runs this simulation.           |
|                                                                                |
|  GitHub page:        https://github.com/asreview/asreview                      |
|  Questions/remarks:  asreview@uu.nl                                            |
|                                                                                |
---------------------------------------------------------------------------------

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/asreview/utils.py", line 189, in _model_class_from_entry_point
    return entry_points[method].load()
KeyError: 'nb_example'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/asreview", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/asreview/__main__.py", line 38, in main
    entry.load()().execute(sys.argv[2:])
  File "/usr/local/lib/python3.6/site-packages/asreview/entry_points/simulate.py", line 34, in execute
    review_simulate(path, **args_dict)
  File "/usr/local/lib/python3.6/site-packages/asreview/review/factory.py", line 252, in review_simulate
    review(dataset, *args, mode='simulate', **kwargs)
  File "/usr/local/lib/python3.6/site-packages/asreview/review/factory.py", line 235, in review
    reviewer = get_reviewer(*args, mode=mode, model=model, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/asreview/review/factory.py", line 177, in get_reviewer
    random_state=random_state)
  File "/usr/local/lib/python3.6/site-packages/asreview/models/utils.py", line 58, in get_model
    model_class = get_model_class(method)
  File "/usr/local/lib/python3.6/site-packages/asreview/models/utils.py", line 43, in get_model_class
    return _model_class_from_entry_point(method, "asreview.models")
  File "/usr/local/lib/python3.6/site-packages/asreview/utils.py", line 192, in _model_class_from_entry_point
    f"Error: method '{method}' is not implemented for entry point "
ValueError: Error: method 'nb_example' is not implemented for entry point asreview.models.

Is there something I am missing?

@Rensvandeschoot
Copy link
Member

Dear @srmeier, thanks for testing this pipeline! Could you upgrade ASReview (+the docker) to the latest version and test again?

@srmeier
Copy link
Author

srmeier commented Mar 15, 2021

Hi @Rensvandeschoot, Thanks. Updated to latest version but receiving a different error now:

docker run -it --entrypoint=/bin/bash -p 5000:5000 asreview/asreview:latest
cd ~
pip install --upgrade asreview
curl https://raw.githubusercontent.com/asreview/systematic-review-datasets/master/datasets/Bos_2018/output/Bos_2018.csv -o Bos_2018.csv
git clone https://github.com/asreview/template-extension-new-model.git
cd template-extension-new-model/
pip install .
cd ..
asreview simulate Bos_2018.csv -m nb_example

Running into the following:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/asreview/utils.py", line 205, in _model_class_from_entry_point
    return entry_points[method].load()
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2447, in load
    return self.resolve()
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2453, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python3.6/site-packages/asreviewcontrib/models/__init__.py", line 1, in <module>
    from asreviewcontrib.models.nb_default_param import NaiveBayesDefaultParamsModel
  File "/usr/local/lib/python3.6/site-packages/asreviewcontrib/models/nb_default_param.py", line 3, in <module>
    from asreview.models.base import BaseTrainModel
ImportError: cannot import name 'BaseTrainModel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/asreview", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/asreview/__main__.py", line 80, in main
    entry.load()().execute(sys.argv[2:])
  File "/usr/local/lib/python3.6/site-packages/asreview/entry_points/simulate.py", line 47, in execute
    review_simulate(path, **args_dict)
  File "/usr/local/lib/python3.6/site-packages/asreview/review/factory.py", line 330, in review_simulate
    review(dataset, *args, mode='simulate', **kwargs)
  File "/usr/local/lib/python3.6/site-packages/asreview/review/factory.py", line 284, in review
    reviewer = get_reviewer(*args, mode=mode, model=model, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/asreview/review/factory.py", line 204, in get_reviewer
    random_state=random_state)
  File "/usr/local/lib/python3.6/site-packages/asreview/models/classifiers/utils.py", line 63, in get_classifier
    model_class = get_classifier_class(name)
  File "/usr/local/lib/python3.6/site-packages/asreview/models/classifiers/utils.py", line 43, in get_classifier_class
    return _model_class_from_entry_point(name, "asreview.models.classifiers")
  File "/usr/local/lib/python3.6/site-packages/asreview/utils.py", line 212, in _model_class_from_entry_point
    f"Failed to import '{method}' model ({entry_name}) "
ValueError: Failed to import 'nb_example' model (asreview.models.classifiers) with the following error:
cannot import name 'BaseTrainModel'

@J535D165
Copy link
Member

J535D165 commented Mar 15, 2021

Sorry for the inconvenience. It turns out to be an issue with the latest tag of our Docker automated builds. Using the specific tag works (and made a small fix in the template). I will work on a fix.

See the updated code for a working version.

docker run -it --entrypoint=/bin/bash -p 5000:5000 asreview/asreview:release-0.16
cd ~
curl https://raw.githubusercontent.com/asreview/systematic-review-datasets/master/datasets/Bos_2018/output/Bos_2018.csv -o Bos_2018.csv
git clone https://github.com/asreview/template-extension-new-model.git
pip install template-extension-new-model/
asreview algorithms
asreview simulate Bos_2018.csv -m nb_example

@J535D165
Copy link
Member

And it might be useful to store your results somewhere.

asreview simulate Bos_2018.csv -m nb_example -s state_bos.h5

@srmeier
Copy link
Author

srmeier commented Mar 16, 2021

Works perfectly, thanks @J535D165 !

@srmeier srmeier closed this as completed Mar 16, 2021
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