A Python library for classifying toxic comments using deep learning.
Project description
# Toxic Comment Classifier
A Python library for classifying toxic comments using deep learning.
## Installation
```python
pip install toxic-comment-classifier
```
## Usage
### Initialize the Model
```python
from toxic_comment_classifier import ToxicCommentClassifier
# Load the classifier
model = ToxicCommentClassifier()
```
### Classify a Single Comment
```python
text = "You are so dumb and stupid!"
scores = model.classify(text)
print("Toxicity Scores:", scores)
```
**Output Example:**
```python
{
"toxic": 0.85,
"severe_toxic": 0.12,
"obscene": 0.78,
"threat": 0.05,
"insult": 0.90,
"identity_hate": 0.03
}
```
### Get Overall Toxicity Score
```python
toxicity = model.predict(text)
print(f"Overall Toxicity Score: {toxicity:.4f}")
```
### Classify Multiple Comments (Batch Processing)
```python
texts = [
"I hate this!",
"You're amazing!",
"This is the worst thing ever!"
]
predictions = model.predict_batch(texts)
for txt, score in zip(texts, predictions):
print(f"Text: {txt} --> Toxicity Score: {score:.4f}")
```
## License
This project is licensed under the MIT License.
```
This keeps things clean, structured, and easy to follow! 🚀 Let me know if you need any modifications.
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file toxic_comment_classifier-0.1.3.tar.gz.
File metadata
- Download URL: toxic_comment_classifier-0.1.3.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cbb595e8c4c812f260f33d398d70d558b1fb59e5de5792e0b4db5a4a12bb402
|
|
| MD5 |
aededa9bd000016b14c13de10bd5c800
|
|
| BLAKE2b-256 |
1eef20123fba843adbf0020b2b7b6785197812806685b6f22e8219404d5a2647
|
File details
Details for the file toxic_comment_classifier-0.1.3-py3-none-any.whl.
File metadata
- Download URL: toxic_comment_classifier-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78b3177ddd332d714c3f2cdde4cbd3930a64a9d815914113f1c685a3c11e31e8
|
|
| MD5 |
7852a6fafd5957503c66161e6c6d9f53
|
|
| BLAKE2b-256 |
24ce1ce3ce38abca0d11ba1143575176d2e0ed515a85ab5360a04aa69bb5d470
|