toxic-comment-classifier 0.2.4__tar.gz → 0.3.0__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.
- {toxic_comment_classifier-0.2.4/toxic_comment_classifier.egg-info → toxic_comment_classifier-0.3.0}/PKG-INFO +24 -22
- {toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0}/README.md +23 -21
- {toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0}/pyproject.toml +1 -1
- {toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0/toxic_comment_classifier.egg-info}/PKG-INFO +24 -22
- {toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0}/LICENSE.txt +0 -0
- {toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0}/MANIFEST.in +0 -0
- {toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0}/setup.cfg +0 -0
- {toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0}/toxic_classifier/__init__.py +0 -0
- {toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0}/toxic_classifier/model/model.weights.h5 +0 -0
- {toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0}/toxic_classifier/model/tokenizer.pickle +0 -0
- {toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0}/toxic_classifier/model.py +0 -0
- {toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0}/toxic_classifier/utils.py +0 -0
- {toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0}/toxic_comment_classifier.egg-info/SOURCES.txt +0 -0
- {toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0}/toxic_comment_classifier.egg-info/dependency_links.txt +0 -0
- {toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0}/toxic_comment_classifier.egg-info/requires.txt +0 -0
- {toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0}/toxic_comment_classifier.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: toxic_comment_classifier
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: A Python library for classifying toxic comments using deep learning. It supports detecting multiple types of toxicity including obscene language, threats, and identity hate.
|
|
5
5
|
Author-email: Md Irfan Ali <irfanali29@hotmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -24,20 +24,19 @@ Requires-Dist: scikit-learn
|
|
|
24
24
|
[](https://pypi.org/project/toxic-comment-classifier/)
|
|
25
25
|
[](https://pepy.tech/project/toxic-comment-classifier)
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
````markdown
|
|
27
|
+
```markdown
|
|
29
28
|
# Toxic Comment Classifier
|
|
30
29
|
|
|
31
30
|
A Python library for classifying toxic comments using deep learning.
|
|
32
31
|
It supports detecting multiple types of toxicity including obscene language, threats, and identity hate.
|
|
32
|
+
```
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
````
|
|
36
34
|
## 📦 Installation
|
|
37
35
|
|
|
38
36
|
```python
|
|
39
37
|
pip install toxic-comment-classifier
|
|
40
38
|
```
|
|
39
|
+
|
|
41
40
|
---
|
|
42
41
|
|
|
43
42
|
## 🚀 Usage
|
|
@@ -59,20 +58,18 @@ model = ToxicCommentClassifier()
|
|
|
59
58
|
text = "You are so dumb and stupid!"
|
|
60
59
|
scores = model.classify(text)
|
|
61
60
|
|
|
62
|
-
|
|
61
|
+
scores
|
|
63
62
|
```
|
|
64
63
|
|
|
65
64
|
**Example Output:**
|
|
66
65
|
|
|
67
66
|
```python
|
|
68
|
-
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
'identity_hate': 0.5006
|
|
75
|
-
}
|
|
67
|
+
{'toxic': 0.9889402985572815,
|
|
68
|
+
'severe_toxic': 0.07256772369146347,
|
|
69
|
+
'obscene': 0.620429277420044,
|
|
70
|
+
'threat': 0.01934845559298992,
|
|
71
|
+
'insult': 0.8664075136184692,
|
|
72
|
+
'identity_hate': 0.04072948172688484}
|
|
76
73
|
```
|
|
77
74
|
|
|
78
75
|
---
|
|
@@ -87,7 +84,7 @@ print(f"Overall Toxicity Score: {toxicity:.4f}")
|
|
|
87
84
|
**Example Output:**
|
|
88
85
|
|
|
89
86
|
```python
|
|
90
|
-
Overall Toxicity Score: 0.
|
|
87
|
+
Overall Toxicity Score: 0.4347
|
|
91
88
|
```
|
|
92
89
|
|
|
93
90
|
---
|
|
@@ -96,9 +93,12 @@ Overall Toxicity Score: 0.4998
|
|
|
96
93
|
|
|
97
94
|
```python
|
|
98
95
|
texts = [
|
|
99
|
-
"I hate
|
|
100
|
-
"
|
|
101
|
-
"
|
|
96
|
+
"I hate you so much!",
|
|
97
|
+
"This is wonderful news.",
|
|
98
|
+
"You're disgusting!",
|
|
99
|
+
"Absolutely love your energy!",
|
|
100
|
+
"You're the worst person ever!",
|
|
101
|
+
"Have a nice day :)"
|
|
102
102
|
]
|
|
103
103
|
|
|
104
104
|
scores = model.predict_batch(texts)
|
|
@@ -110,10 +110,12 @@ for txt, score in zip(texts, scores):
|
|
|
110
110
|
**Example Output:**
|
|
111
111
|
|
|
112
112
|
```python
|
|
113
|
-
Text: I hate
|
|
114
|
-
Text:
|
|
115
|
-
Text:
|
|
113
|
+
Text: I hate you so much! --> Toxicity Score: 0.1395
|
|
114
|
+
Text: This is wonderful news. --> Toxicity Score: 0.0013
|
|
115
|
+
Text: You're disgusting! --> Toxicity Score: 0.3110
|
|
116
|
+
Text: Absolutely love your energy! --> Toxicity Score: 0.0088
|
|
117
|
+
Text: You're the worst person ever! --> Toxicity Score: 0.0937
|
|
118
|
+
Text: Have a nice day :) --> Toxicity Score: 0.0115
|
|
116
119
|
```
|
|
117
120
|
|
|
118
121
|
---
|
|
119
|
-
|
|
@@ -5,20 +5,19 @@
|
|
|
5
5
|
[](https://pypi.org/project/toxic-comment-classifier/)
|
|
6
6
|
[](https://pepy.tech/project/toxic-comment-classifier)
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
````markdown
|
|
8
|
+
```markdown
|
|
10
9
|
# Toxic Comment Classifier
|
|
11
10
|
|
|
12
11
|
A Python library for classifying toxic comments using deep learning.
|
|
13
12
|
It supports detecting multiple types of toxicity including obscene language, threats, and identity hate.
|
|
13
|
+
```
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
````
|
|
17
15
|
## 📦 Installation
|
|
18
16
|
|
|
19
17
|
```python
|
|
20
18
|
pip install toxic-comment-classifier
|
|
21
19
|
```
|
|
20
|
+
|
|
22
21
|
---
|
|
23
22
|
|
|
24
23
|
## 🚀 Usage
|
|
@@ -40,20 +39,18 @@ model = ToxicCommentClassifier()
|
|
|
40
39
|
text = "You are so dumb and stupid!"
|
|
41
40
|
scores = model.classify(text)
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
scores
|
|
44
43
|
```
|
|
45
44
|
|
|
46
45
|
**Example Output:**
|
|
47
46
|
|
|
48
47
|
```python
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
'identity_hate': 0.5006
|
|
56
|
-
}
|
|
48
|
+
{'toxic': 0.9889402985572815,
|
|
49
|
+
'severe_toxic': 0.07256772369146347,
|
|
50
|
+
'obscene': 0.620429277420044,
|
|
51
|
+
'threat': 0.01934845559298992,
|
|
52
|
+
'insult': 0.8664075136184692,
|
|
53
|
+
'identity_hate': 0.04072948172688484}
|
|
57
54
|
```
|
|
58
55
|
|
|
59
56
|
---
|
|
@@ -68,7 +65,7 @@ print(f"Overall Toxicity Score: {toxicity:.4f}")
|
|
|
68
65
|
**Example Output:**
|
|
69
66
|
|
|
70
67
|
```python
|
|
71
|
-
Overall Toxicity Score: 0.
|
|
68
|
+
Overall Toxicity Score: 0.4347
|
|
72
69
|
```
|
|
73
70
|
|
|
74
71
|
---
|
|
@@ -77,9 +74,12 @@ Overall Toxicity Score: 0.4998
|
|
|
77
74
|
|
|
78
75
|
```python
|
|
79
76
|
texts = [
|
|
80
|
-
"I hate
|
|
81
|
-
"
|
|
82
|
-
"
|
|
77
|
+
"I hate you so much!",
|
|
78
|
+
"This is wonderful news.",
|
|
79
|
+
"You're disgusting!",
|
|
80
|
+
"Absolutely love your energy!",
|
|
81
|
+
"You're the worst person ever!",
|
|
82
|
+
"Have a nice day :)"
|
|
83
83
|
]
|
|
84
84
|
|
|
85
85
|
scores = model.predict_batch(texts)
|
|
@@ -91,10 +91,12 @@ for txt, score in zip(texts, scores):
|
|
|
91
91
|
**Example Output:**
|
|
92
92
|
|
|
93
93
|
```python
|
|
94
|
-
Text: I hate
|
|
95
|
-
Text:
|
|
96
|
-
Text:
|
|
94
|
+
Text: I hate you so much! --> Toxicity Score: 0.1395
|
|
95
|
+
Text: This is wonderful news. --> Toxicity Score: 0.0013
|
|
96
|
+
Text: You're disgusting! --> Toxicity Score: 0.3110
|
|
97
|
+
Text: Absolutely love your energy! --> Toxicity Score: 0.0088
|
|
98
|
+
Text: You're the worst person ever! --> Toxicity Score: 0.0937
|
|
99
|
+
Text: Have a nice day :) --> Toxicity Score: 0.0115
|
|
97
100
|
```
|
|
98
101
|
|
|
99
102
|
---
|
|
100
|
-
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "toxic_comment_classifier"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.3.0"
|
|
4
4
|
description = " A Python library for classifying toxic comments using deep learning. It supports detecting multiple types of toxicity including obscene language, threats, and identity hate."
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Md Irfan Ali", email = "irfanali29@hotmail.com" }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: toxic_comment_classifier
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: A Python library for classifying toxic comments using deep learning. It supports detecting multiple types of toxicity including obscene language, threats, and identity hate.
|
|
5
5
|
Author-email: Md Irfan Ali <irfanali29@hotmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -24,20 +24,19 @@ Requires-Dist: scikit-learn
|
|
|
24
24
|
[](https://pypi.org/project/toxic-comment-classifier/)
|
|
25
25
|
[](https://pepy.tech/project/toxic-comment-classifier)
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
````markdown
|
|
27
|
+
```markdown
|
|
29
28
|
# Toxic Comment Classifier
|
|
30
29
|
|
|
31
30
|
A Python library for classifying toxic comments using deep learning.
|
|
32
31
|
It supports detecting multiple types of toxicity including obscene language, threats, and identity hate.
|
|
32
|
+
```
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
````
|
|
36
34
|
## 📦 Installation
|
|
37
35
|
|
|
38
36
|
```python
|
|
39
37
|
pip install toxic-comment-classifier
|
|
40
38
|
```
|
|
39
|
+
|
|
41
40
|
---
|
|
42
41
|
|
|
43
42
|
## 🚀 Usage
|
|
@@ -59,20 +58,18 @@ model = ToxicCommentClassifier()
|
|
|
59
58
|
text = "You are so dumb and stupid!"
|
|
60
59
|
scores = model.classify(text)
|
|
61
60
|
|
|
62
|
-
|
|
61
|
+
scores
|
|
63
62
|
```
|
|
64
63
|
|
|
65
64
|
**Example Output:**
|
|
66
65
|
|
|
67
66
|
```python
|
|
68
|
-
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
'identity_hate': 0.5006
|
|
75
|
-
}
|
|
67
|
+
{'toxic': 0.9889402985572815,
|
|
68
|
+
'severe_toxic': 0.07256772369146347,
|
|
69
|
+
'obscene': 0.620429277420044,
|
|
70
|
+
'threat': 0.01934845559298992,
|
|
71
|
+
'insult': 0.8664075136184692,
|
|
72
|
+
'identity_hate': 0.04072948172688484}
|
|
76
73
|
```
|
|
77
74
|
|
|
78
75
|
---
|
|
@@ -87,7 +84,7 @@ print(f"Overall Toxicity Score: {toxicity:.4f}")
|
|
|
87
84
|
**Example Output:**
|
|
88
85
|
|
|
89
86
|
```python
|
|
90
|
-
Overall Toxicity Score: 0.
|
|
87
|
+
Overall Toxicity Score: 0.4347
|
|
91
88
|
```
|
|
92
89
|
|
|
93
90
|
---
|
|
@@ -96,9 +93,12 @@ Overall Toxicity Score: 0.4998
|
|
|
96
93
|
|
|
97
94
|
```python
|
|
98
95
|
texts = [
|
|
99
|
-
"I hate
|
|
100
|
-
"
|
|
101
|
-
"
|
|
96
|
+
"I hate you so much!",
|
|
97
|
+
"This is wonderful news.",
|
|
98
|
+
"You're disgusting!",
|
|
99
|
+
"Absolutely love your energy!",
|
|
100
|
+
"You're the worst person ever!",
|
|
101
|
+
"Have a nice day :)"
|
|
102
102
|
]
|
|
103
103
|
|
|
104
104
|
scores = model.predict_batch(texts)
|
|
@@ -110,10 +110,12 @@ for txt, score in zip(texts, scores):
|
|
|
110
110
|
**Example Output:**
|
|
111
111
|
|
|
112
112
|
```python
|
|
113
|
-
Text: I hate
|
|
114
|
-
Text:
|
|
115
|
-
Text:
|
|
113
|
+
Text: I hate you so much! --> Toxicity Score: 0.1395
|
|
114
|
+
Text: This is wonderful news. --> Toxicity Score: 0.0013
|
|
115
|
+
Text: You're disgusting! --> Toxicity Score: 0.3110
|
|
116
|
+
Text: Absolutely love your energy! --> Toxicity Score: 0.0088
|
|
117
|
+
Text: You're the worst person ever! --> Toxicity Score: 0.0937
|
|
118
|
+
Text: Have a nice day :) --> Toxicity Score: 0.0115
|
|
116
119
|
```
|
|
117
120
|
|
|
118
121
|
---
|
|
119
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{toxic_comment_classifier-0.2.4 → toxic_comment_classifier-0.3.0}/toxic_classifier/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|