valx 0.2.3__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: valx
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: An open-source Python library for data cleaning tasks. Includes profanity detection, and removal. Now includes offensive language and hate speech detection using an AI model.
5
5
  Home-page: https://github.com/infinitode/valx
6
6
  Author: Infinitode Pty Ltd
7
7
  Author-email: infinitode.ltd@gmail.com
8
- Classifier: Development Status :: 3 - Alpha
8
+ Classifier: Development Status :: 5 - Production/Stable
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Programming Language :: Python :: 3.6
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.12
18
18
  Requires-Python: >=3.6
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
- Requires-Dist: scikit-learn==1.2.2
21
+ Requires-Dist: scikit-learn
22
22
 
23
23
  # ValX
24
24
  ![Python Version](https://img.shields.io/badge/python-3.12-blue.svg)
@@ -33,6 +33,12 @@ An open-source Python library for data cleaning tasks. It includes functions for
33
33
  > Please downgrade to `numpy` version `1.26.4`. Our ValX **DecisionTreeClassifier** AI model, relies on lower versions of `numpy`, because it was trained on these versions.
34
34
  > For more information see: https://techoverflow.net/2024/07/23/how-to-fix-numpy-dtype-size-changed-may-indicate-binary-incompatibility-expected-96-from-c-header-got-88-from-pyobject/
35
35
 
36
+ ## Changes in 0.2.4
37
+
38
+ Fixed a major incompatibility issue with `scikit-learn` due to version changes in `scikit-learn v1.3.0` which causes compatibility issues with versions later than `1.2.2`. ValX can now be used with `scikit-learn` versions earlier and later than `1.3.0`!
39
+
40
+ We've also removed `scikit-learn==1.2.2` as a dependency, as most versions of `scikit-learn` will now work.
41
+
36
42
  ## Changes in 0.2.3
37
43
 
38
44
  We have introduced a new optional `info_type` parameter into our `detect_sensitive_information`, and `remove_sensitive_information` functions, to allow you to have fine-grained control over what sensitive information you want to detect or remove.
@@ -11,6 +11,12 @@ An open-source Python library for data cleaning tasks. It includes functions for
11
11
  > Please downgrade to `numpy` version `1.26.4`. Our ValX **DecisionTreeClassifier** AI model, relies on lower versions of `numpy`, because it was trained on these versions.
12
12
  > For more information see: https://techoverflow.net/2024/07/23/how-to-fix-numpy-dtype-size-changed-may-indicate-binary-incompatibility-expected-96-from-c-header-got-88-from-pyobject/
13
13
 
14
+ ## Changes in 0.2.4
15
+
16
+ Fixed a major incompatibility issue with `scikit-learn` due to version changes in `scikit-learn v1.3.0` which causes compatibility issues with versions later than `1.2.2`. ValX can now be used with `scikit-learn` versions earlier and later than `1.3.0`!
17
+
18
+ We've also removed `scikit-learn==1.2.2` as a dependency, as most versions of `scikit-learn` will now work.
19
+
14
20
  ## Changes in 0.2.3
15
21
 
16
22
  We have introduced a new optional `info_type` parameter into our `detect_sensitive_information`, and `remove_sensitive_information` functions, to allow you to have fine-grained control over what sensitive information you want to detect or remove.
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name='valx',
8
- version='0.2.3',
8
+ version='0.2.4',
9
9
  author='Infinitode Pty Ltd',
10
10
  author_email='infinitode.ltd@gmail.com',
11
11
  description='An open-source Python library for data cleaning tasks. Includes profanity detection, and removal. Now includes offensive language and hate speech detection using an AI model.',
@@ -15,10 +15,10 @@ setup(
15
15
  packages=find_packages(),
16
16
  package_data={'valx': ['models/*']},
17
17
  install_requires=[
18
- 'scikit-learn==1.2.2' # for the AI to function properly
18
+ 'scikit-learn'
19
19
  ],
20
20
  classifiers=[
21
- 'Development Status :: 3 - Alpha',
21
+ 'Development Status :: 5 - Production/Stable',
22
22
  'Intended Audience :: Developers',
23
23
  'License :: OSI Approved :: MIT License',
24
24
  'Programming Language :: Python :: 3.6',
@@ -3,6 +3,7 @@ import re
3
3
 
4
4
  # New version, that includes AI detection
5
5
  import pickle
6
+ from sklearn import __version__ as sklearnversion
6
7
  from sklearn.tree import DecisionTreeClassifier # Import the DecisionTreeClassifier class
7
8
  from sklearn.feature_extraction.text import CountVectorizer # Import the CountVectorizer class
8
9
 
@@ -2902,8 +2903,18 @@ def remove_sensitive_information(text_data, output_file=None, info_type=["email"
2902
2903
 
2903
2904
  # New version
2904
2905
  MODEL_DIR = os.path.join(os.path.dirname(__file__), 'models')
2905
- DECISION_TREE_MODEL_PATH = os.path.join(MODEL_DIR, 'decision_tree_model.sav')
2906
2906
  COUNT_VECTORIZER_PATH = os.path.join(MODEL_DIR, 'count_vectorizer.sav')
2907
+ DEFAULT_MODEL_FILENAME = "decision_tree_model.sav"
2908
+ UPGRADED_MODEL_FILENAME = "classifier_upgraded.pkl"
2909
+
2910
+ # Check scikit-learn version
2911
+ SKLEARN_VERSION = tuple(map(int, sklearnversion.split(".")))
2912
+
2913
+ # Set the model path based on the version
2914
+ if SKLEARN_VERSION >= (1, 3, 0):
2915
+ DECISION_TREE_MODEL_PATH = os.path.join(MODEL_DIR, UPGRADED_MODEL_FILENAME)
2916
+ else:
2917
+ DECISION_TREE_MODEL_PATH = os.path.join(MODEL_DIR, DEFAULT_MODEL_FILENAME)
2907
2918
 
2908
2919
  # Load the saved models
2909
2920
  model = pickle.load(open(DECISION_TREE_MODEL_PATH, 'rb'))
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: valx
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: An open-source Python library for data cleaning tasks. Includes profanity detection, and removal. Now includes offensive language and hate speech detection using an AI model.
5
5
  Home-page: https://github.com/infinitode/valx
6
6
  Author: Infinitode Pty Ltd
7
7
  Author-email: infinitode.ltd@gmail.com
8
- Classifier: Development Status :: 3 - Alpha
8
+ Classifier: Development Status :: 5 - Production/Stable
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Programming Language :: Python :: 3.6
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.12
18
18
  Requires-Python: >=3.6
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
- Requires-Dist: scikit-learn==1.2.2
21
+ Requires-Dist: scikit-learn
22
22
 
23
23
  # ValX
24
24
  ![Python Version](https://img.shields.io/badge/python-3.12-blue.svg)
@@ -33,6 +33,12 @@ An open-source Python library for data cleaning tasks. It includes functions for
33
33
  > Please downgrade to `numpy` version `1.26.4`. Our ValX **DecisionTreeClassifier** AI model, relies on lower versions of `numpy`, because it was trained on these versions.
34
34
  > For more information see: https://techoverflow.net/2024/07/23/how-to-fix-numpy-dtype-size-changed-may-indicate-binary-incompatibility-expected-96-from-c-header-got-88-from-pyobject/
35
35
 
36
+ ## Changes in 0.2.4
37
+
38
+ Fixed a major incompatibility issue with `scikit-learn` due to version changes in `scikit-learn v1.3.0` which causes compatibility issues with versions later than `1.2.2`. ValX can now be used with `scikit-learn` versions earlier and later than `1.3.0`!
39
+
40
+ We've also removed `scikit-learn==1.2.2` as a dependency, as most versions of `scikit-learn` will now work.
41
+
36
42
  ## Changes in 0.2.3
37
43
 
38
44
  We have introduced a new optional `info_type` parameter into our `detect_sensitive_information`, and `remove_sensitive_information` functions, to allow you to have fine-grained control over what sensitive information you want to detect or remove.
@@ -7,5 +7,6 @@ valx.egg-info/SOURCES.txt
7
7
  valx.egg-info/dependency_links.txt
8
8
  valx.egg-info/requires.txt
9
9
  valx.egg-info/top_level.txt
10
+ valx/models/classifier_upgraded.pkl
10
11
  valx/models/count_vectorizer.sav
11
12
  valx/models/decision_tree_model.sav
@@ -0,0 +1 @@
1
+ scikit-learn
@@ -1 +0,0 @@
1
- scikit-learn==1.2.2
File without changes
File without changes
File without changes