Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TOXIC COMMENT ANALYSIS #564

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,702 changes: 1,702 additions & 0 deletions Toxic Comment Analysis/Dataset/EI-reg-En-anger-train.txt

Large diffs are not rendered by default.

Binary file added Toxic Comment Analysis/Images/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Toxic Comment Analysis/Images/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Toxic Comment Analysis/Images/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,871 changes: 1,871 additions & 0 deletions Toxic Comment Analysis/Models/Model.ipynb

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions Toxic Comment Analysis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# TOXIC COMMENT ANALYSIS

## GOAL
Develop a machine learning model to tell whether a comment is toxic or not

## DATASET
Explore https://www.kaggle.com/datasets/devkhant24/toxic-comment

## MODELS USED
- Naive Bayes
- Random Forest
- Catboost
- Decision Tree
- Bidirectional LSTM
- RNN
- Logistic Regression

## LIBRARIES
- Pandas
- Numpy
- TensorFlow
- Seaborn
- Matplotlib
- Scikit-Learn
- OS
- Re
- Math
- Beautiful Soup
- NLTK
- Spacy

## IMPLEMENTATION
1. Loaded Dataset
2. Converted into standard csv file and renamed columns for ease.
3. Implemented cleaning and preprocessing to remove any emojis,symbols,links,etc
4. Classified toxic comment on the basis if intensity of angered comment > 0.55 then its toxic.
5. Implement tokenization for sequence conversion.
6. Trained models with various algorithms.

## Models and Accuracies

| Model | Accuracy |
| ----------------- |:----------:|
| Naive Bayes | 0.77 |
| Random Forest | 0.76 |
| Catboost | 0.74 |
| Logistic Regression| 0.77 |
| Decision Tree | 0.73 |
| RNN | 0.69 |
| Bidirectional LSTM | 0.68 |

**VISUALISATION**

![Alt Text](./Images/1.png)

![Alt Text](./Images/2.png)

![Alt Text](./Images/3.png)

**CONCLUSION**

Naive Bayes and Logistic Regression Model have the best accuracy in detecting toxicity of a comment

**NAME**

Keshav Arora
4 changes: 4 additions & 0 deletions Toxic Comment Analysis/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pandas==1.3.3
matplotlib==3.4.3
numpy==1.21.2
catboost==1.2.2
Loading