Api_toxicity is a Flask-based application that offers multi-label image and text classification capabilities. The application can detect toxic sentences in text and classify explicit and unpleasant images.
- Features
- Repository Structure
- Endpoints
- Screenshots
- Installation and Setup
- Usage
- Dependencies
- Contributing
- License
- Text Classification: Detects toxic sentences.
- Image Classification: Classifies images into categories like drugs, normal, pornographic, and unpleasant visuals.
- Flask API: Provides endpoints to check toxicity in text and images.
api.py
: Flask API that provides endpoints for checking toxicity in text and images.image_classif.py
: Contains the image classification model built using ResNet50.testing_model.py
: Script to test the model's performance.trp_sample.py
: Sample script to test the text classification model.Toxicity.h5
: Pre-trained model for text classification.image_classificationD32.h5
&image_classificationDR32.h5
: Pre-trained models for image classification.tokenizer.pickle
: Tokenizer used for text preprocessing.requirements.txt
: List of required packages to run the project.
/
: Main endpoint that renders the main HTML page./toxicity_check
: Endpoint to check the toxicity of a given text./toxicity_image_text
: Endpoint to check toxicity in both text and images.
- Clone the repository:
git clone https://github.com/Gourav2000/Api_toxicity.git
- Navigate to the project directory:
cd Api_toxicity
- Install the required dependencies:
pip install -r requirements.txt
- Run the app:
python api.py
- To check for toxicity in text, use the
/toxicity_check
endpoint with thetext
parameter. - To classify images and text for toxicity, use the
/toxicity_image_text
endpoint with thetoxic_image
andtox_text
parameters.
The application relies on several libraries and frameworks, including Flask, TensorFlow, Keras, and PIL. For a complete list, refer to the requirements.txt
file.
Contributions are welcome! Feel free to fork the repository, make changes, and submit pull requests.
Please refer to the LICENSE
file in the repository for licensing information.