Error installing sentence transformers for sBERT #1841
-
I am starting phase 3 of the SAFE protocol while screening abstracts. I want to use sBERT as the feature extractor. I followed the steps to install the sentence transformers, but I get the following error when training the model in ASReview: ImportError: Install sentence-transformers package to use Sentence BERT. When I try to install the sentence transformers, I get the below warning. Any ideas how I can resolve this? Many thanks. C:\Users\cathalohara>pip install asreview[sentence_transformers] |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 23 replies
-
Hi! I think the installation instructions are a bit off then. Can you point us to where you found these instructions? For sbert we need some special packages in Python. I think running ^JT |
Beta Was this translation helpful? Give feedback.
-
I too have trouble installing? and using SBert. I used: Python -m pip install asreview[sentence_transformers] to intall it. And that seemed to have been succesfull. However, I get an error message no matter what other classifer and so on I pick in asreview lab. I guess it states I haven't yet installed the package. I tried: python -m pip install sentence-transformers tf-keras, or with capitol P for python, but that just errors. Also tried asreview[all], but same issues. Seems to install a bunch, but cannot utilize SBert in ASReview lab. |
Beta Was this translation helpful? Give feedback.
-
Also, I upgraded to asreview1.6.3, and tried installing sBert again. I still get this message: WARNING: asreview 1.6.3 does not provide the extra 'sentence-transformers'. |
Beta Was this translation helpful? Give feedback.
-
Tried it. It says that some requirements are already satified, but then it says: Installing collected packages: transformers, sentence-transformers |
Beta Was this translation helpful? Give feedback.
-
Hi! I ran into the same issue as written above. Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
Beta Was this translation helpful? Give feedback.
-
@jteijema and @Rensvandeschoot I came here because of the same issue as the topicstarter in #1841. I encountered these errors on two different office devices on which I've used ASReview before, so I just tried everything again on a fresh personal computer. Unfortunately, no luck yet. Both One of the suggested fixes is to run I tried your first solution: I then tried the next solution: creating a virtual environment (see your comment of 18 sept). After activating and rerunning
pip 24.3.1
Any idea how to fix this? |
Beta Was this translation helpful? Give feedback.
Well I'm at a loss. This might be something environment related, or maybe administration access rights. @J535D165, do you have an idea?
In the mean time, I'm out of simple things to try, but if you're up for it, we can try some more difficult things:
python -m venv env
. A virtual environment is a portable python installation. It will be totally independent from your other python installation. If you activate it in the terminal, everything will be run from this portable installation.Activate it: