Skip to content

Prudhvinani07/Toxic_comment_classification_using_bert

Repository files navigation

Toxic Comment Classifier 🔍

➡️ Short Description: A Streamlit application that uses a BERT-based model to detect and classify toxic comments across multiple categories.

🤔 What does it do?

This application analyzes text for different types of toxicity:

  • Detects general toxicity in text
  • Identifies severe toxic content
  • Recognizes obscene language
  • Detects threats in text
  • Identifies insulting content
  • Recognizes identity-based hate speech

The app provides visual gauge charts showing the probability of each toxicity type, making it easy to interpret the results.

🚀 How to use it?

  1. Log in with your Supabase credentials (or use demo mode if authentication is disabled)
  2. Enter the text you want to analyze in the text area
  3. Click the "Analyze" button
  4. View the results showing different toxicity scores as gauge charts
  5. See an overall assessment of the text's toxicity

🛠️ Dependencies

This application requires the following main libraries:

  • Streamlit for the user interface
  • PyTorch and Transformers for the BERT model
  • Supabase for authentication
  • Plotly for visualization

All dependencies are listed in the requirements.txt file and are automatically installed during the build process.

📄 Files

  • app.py: The main Streamlit application
  • auth.py: Authentication logic using Supabase
  • requirements.txt: Lists all Python dependencies
  • Dockerfile: Container configuration for Hugging Face Spaces
  • saved/: Directory for storing the trained model
  • src/: Source code for the model and preprocessing

🧠 Model Information

The model is a fine-tuned BERT classifier trained on the Toxic Comment Classification Dataset. It predicts six different types of toxicity:

  • Toxic: General category for unpleasant content
  • Severe Toxic: Extreme cases of toxicity
  • Obscene: Explicit or vulgar content
  • Threat: Expressions of intent to harm
  • Insult: Disrespectful or demeaning language
  • Identity Hate: Prejudiced language against protected characteristics

Created by Ralph

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •