meyersbs / uncertainty

A Python implementation of the uncertainty classifier, based on the work of Veronika Vincze.
MIT License
16 stars 4 forks source link

Error in installation #7

Open afshinrahimi opened 2 years ago

afshinrahimi commented 2 years ago

Hi, I'm using 'pip install uncertainty' and getting error in installing dependencies such as numpy (due to old versions maybe). Is it possible to update the repo based on newer dependencies, please?

afshinrahimi commented 2 years ago

Found that if you install python 3.5, install the compatible numpy, scipy and sklearn 0.18, then you can run it. However, it doesn't work with later versions of Python.

meyersbs commented 2 years ago

Can you provide:

Please note that Python 2 is not, and never will be, supported.

afshinrahimi commented 2 years ago

The error was during numpy (old version) installation on newer pythons e.g. 3.8 (uncertainty itself installed smoothly without numpy). Had to install python 3.5 in an environment so that i can install sklearn 0.18 which is required for loading the pretrained pickle files. Will report the exact errors later.

gomagwu commented 2 years ago

@afshinrahimi can you write the numpy and scipy versions that you installed

afshinrahimi commented 2 years ago

Sorry, forgotten the versions now, but a numpy and scipy in the same time period matching sklearn 0.18 would do.

jonatelintelo commented 1 year ago

So Python 3.5, sklearn 0.18 and matching scipy plus numpy should make the installation guide run without errors in cmd?

afshinrahimi commented 1 year ago

First install Python 3.5 and sklearn 0.18. Then, install the package and you'll see the error produced. Now, to fix the issue, find out when sklearn 0.18 was released and try numpy and scipy versions within a few months before and after the release date to find the combination that works.

Apologies, don't have access to the system that tried this on before.

jonatelintelo commented 1 year ago

Thanks, did you use it in your cmd? or in some virtual environment/ide?

afshinrahimi commented 1 year ago

I used an environment.

jonatelintelo commented 1 year ago

I actually seem to got it working somewhat in google colab after forcing it to python 3.5, no manual installation of packages needed.

However running the command: !python /content/uncertainty/main.py predict --granularity=word "I wonder if I am the walrus."

Produces a warning: /usr/local/lib/python3.5/dist-packages/nltk/tokenize/regexp.py:123: FutureWarning: split() requires a non-empty pattern match. return [tok for tok in self._regexp.split(text) if tok] I wonder if I am the walrus.: ['C', 'C', 'U', 'C', 'C', 'C', 'C', 'C']

Additionally, execution for 1 sentence seems unusually long at 10 seconds. How was the execution time for you?