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

Swap scikit learn dependency #13

Closed dimitrismistriotis closed 4 years ago

dimitrismistriotis commented 4 years ago

As discussed in https://github.com/vzhou842/profanity-check/issues/11 importing joblib

Note:

Using the lastest version of sklearn getting the following warnings suggesting it might be a good idea to re-import the data and pin to latest version.

/home/dimitry/.virtualenvs/profanity_check/lib/python3.8/site-packages/sklearn/base.py:313: UserWarning: Trying to unpickle estimator CountVectorizer from version 0.20.2 when using version 0.22.2.post1. This might lead to breaking code or invalid results. Use at your own risk.
  warnings.warn(
/home/dimitry/.virtualenvs/profanity_check/lib/python3.8/site-packages/sklearn/utils/deprecation.py:144: FutureWarning: The sklearn.svm.classes module is  deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.svm. Anything that cannot be imported from sklearn.svm is now part of the private API.
  warnings.warn(message, FutureWarning)
/home/dimitry/.virtualenvs/profanity_check/lib/python3.8/site-packages/sklearn/base.py:313: UserWarning: Trying to unpickle estimator LinearSVC from version 0.20.2 when using version 0.22.2.post1. This might lead to breaking code or invalid results. Use at your own risk.
  warnings.warn(
/home/dimitry/.virtualenvs/profanity_check/lib/python3.8/site-packages/sklearn/externals/joblib/__init__.py:15: FutureWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+.
  warnings.warn(msg, category=FutureWarning)
/home/dimitry/.virtualenvs/profanity_check/lib/python3.8/site-packages/sklearn/utils/deprecation.py:144: FutureWarning: The sklearn.preprocessing.label module is  deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.preprocessing. Anything that cannot be imported from sklearn.preprocessing is now part of the private API.
  warnings.warn(message, FutureWarning)
/home/dimitry/.virtualenvs/profanity_check/lib/python3.8/site-packages/sklearn/base.py:313: UserWarning: Trying to unpickle estimator LabelEncoder from version 0.20.2 when using version 0.22.2.post1. This might lead to breaking code or invalid results. Use at your own risk.
  warnings.warn(
/home/dimitry/.virtualenvs/profanity_check/lib/python3.8/site-packages/sklearn/base.py:313: UserWarning: Trying to unpickle estimator _SigmoidCalibration from version 0.20.2 when using version 0.22.2.post1. This might lead to breaking code or invalid results. Use at your own risk.
  warnings.warn(
/home/dimitry/.virtualenvs/profanity_check/lib/python3.8/site-packages/sklearn/base.py:313: UserWarning: Trying to unpickle estimator CalibratedClassifierCV from version 0.20.2 when using version 0.22.2.post1. This might lead to breaking code or invalid results. Use at your own risk.
  warnings.warn(
toddsifleet commented 4 years ago

This is very helpful I ran into the same issue.

dimitrismistriotis commented 4 years ago

@toddsifleet For the time being on the project I work for we forked and used a pinned version of scikit-learn: https://github.com/dimitrismistriotis/profanity-check/

toddsifleet commented 4 years ago

@dimitrismistriotis thank you!

vzhou842 commented 4 years ago

sorry I didn't see this until now - thanks for the fix!