profanity-check icon indicating copy to clipboard operation
profanity-check copied to clipboard

Import error

Open Logothetiz opened this issue 3 years ago • 6 comments

Traceback (most recent call last): File "D:/Work/Tests-Tutorials/german/TEIST.py", line 1, in from profanity_check import predict, predict_prob File "C:\Users\fasol\AppData\Local\Programs\Python\Python38\lib\site-packages\profanity_check_init_.py", line 1, in from .profanity_check import predict, predict_prob File "C:\Users\fasol\AppData\Local\Programs\Python\Python38\lib\site-packages\profanity_check\profanity_check.py", line 3, in from sklearn.externals import joblib ImportError: cannot import name 'joblib' from 'sklearn.externals' (C:\Users\fasol\AppData\Local\Programs\Python\Python38\lib\site-packages\sklearn\externals_init_.py)

Logothetiz avatar May 01 '21 14:05 Logothetiz

from profanity_check import predict, predict_prob

predict(['predict() takes an array and returns a 1 for each string if it is offensive, else 0.'])

[0]

predict(['fuck you'])

[1]

predict_prob(['predict_prob() takes an array and returns the probability each string is offensive'])

[0.08686173]

predict_prob(['go to hell, you scum'])

[0.7618861]

Code that generated it (copy paste from module site)

Logothetiz avatar May 01 '21 14:05 Logothetiz

Can you please help me with making a better Profanity Filtering on GitHub App

travislibby000000 avatar May 01 '21 16:05 travislibby000000

@Logothetiz @travislibby000000 please communicate more clearly what you are trying to do.

BradKML avatar May 02 '21 01:05 BradKML

I wanted to test the module to see if and how it works and to start I copy pasted the usage section of this site https://pypi.org/project/profanity-check/

Logothetiz avatar May 02 '21 07:05 Logothetiz

Found this as an alternative:

https://pypi.org/project/alt-profanity-check/

Worked for me with Python 3.8

xhulianoThe1 avatar May 25 '21 03:05 xhulianoThe1

You can follow the alt-profanity-check package here: https://gitlab.com/dimitrios/alt-profanity-check

menkotoglou avatar Aug 16 '21 18:08 menkotoglou