Giter VIP home page Giter VIP logo

api_toxicity's Introduction

Api_toxicity

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.

Table of Contents

Features:

  • 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.

Repository Structure:

  • 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.

Endpoints:

  • /: 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.

Screenshots

Text classification sample

Text Classification Sample

Image classification sample

Image Classification Sample

Installation and Setup

  1. Clone the repository:
git clone https://github.com/Gourav2000/Api_toxicity.git
  1. Navigate to the project directory:
cd Api_toxicity
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Run the app:
python api.py

Usage

  • To check for toxicity in text, use the /toxicity_check endpoint with the text parameter.
  • To classify images and text for toxicity, use the /toxicity_image_text endpoint with the toxic_image and tox_text parameters.

Dependencies

The application relies on several libraries and frameworks, including Flask, TensorFlow, Keras, and PIL. For a complete list, refer to the requirements.txt file.

Contributing

Contributions are welcome! Feel free to fork the repository, make changes, and submit pull requests.

License

Please refer to the LICENSE file in the repository for licensing information.

api_toxicity's People

Contributors

gourav2000 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.