A YouTube Comment Toxicity Detector built using TensorFlow, NLP, and Gradio that allows users to check the toxicity of individual comments or analyze the toxicity of comments from any YouTube video.
- Custom Comment Checker: Enter any text and check its toxicity.
- YouTube Comment Analyzer: Fetch comments from a YouTube video and analyze toxicity.
- Multi-Label Classification: Detects multiple types of toxicity, including:
- Toxic
- Severe Toxic
- Obscene
- Threat
- Insult
- Identity Hate
- Interactive UI with Gradio
- Color-Coded Output: 🚨 Red for toxic labels, ✅ Green for non-toxic labels.
- Python
- TensorFlow / Keras (Deep Learning Model)
- NLP (Natural Language Processing)
- Pandas & NumPy (Data Handling)
- Google YouTube API (Fetching YouTube Comments)
- Gradio (User Interface)
git clone https://github.com/Codebreaker42/comment-toxicity.git
cd youtube-toxicity-detectorpython -m venv your_virtual_env_name
source your_virtual_env_name/bin/activate # On Mac/Linux
your_virtual_env_name\Scripts\activate # On Windowspip install -r requirements.txtEnsure you have the required toxicity.keras model and vectorizer.pkl file in the comment_checkpoint/ directory.
🔹 Start the Gradio App
python app.py🔹 Access the Interface Once running, open the URL (shown in the terminal) in your browser.
✅ Check Custom Comment
- Enter a comment in the Text Box.
- Click Analyze.
- See toxicity labels with color indicators
- 🔴 Red → Toxic
- ✅ Green → Not Toxic
✅ Analyze YouTube Comments
- Paste the YouTube Video URL. Click Analyze.
- View a table of comments with toxicity analysis.
- View a table of comments with toxicity analysis.
- Text is tokenized using a saved vectorizer (vectorizer.pkl).
- The input is padded to MAX_LEN = 1800.
- A deep learning model (toxicity.keras) predicts six toxicity labels.
- Uses Google YouTube API to fetch comments.
- Each comment is analyzed for toxicity.
- Ensure toxicity.keras and vectorizer.pkl exist in the comment_checkpoint/ directory.
- Replace the API key in app.py with your own Google API key.
This project is open-source and available under the MIT License.
- 💼 GitHub: https://github.com/Codebreaker42
- 📧 Email: nitinbdkt777@gmail.com
Name


