vzhou842 / profanity-check

A fast, robust Python library to check for offensive language in strings.
https://pypi.org/project/profanity-check
MIT License
612 stars 113 forks source link

Import error #36

Open Logothetiz opened 3 years ago

Logothetiz commented 3 years ago

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 commented 3 years ago

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)

travislibby000000 commented 3 years ago

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

BradKML commented 3 years ago

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

Logothetiz commented 3 years ago

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/

xhulianoThe1 commented 3 years ago

Found this as an alternative:

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

Worked for me with Python 3.8

menkotoglou commented 2 years ago

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