Skip to content

A mini content moderation project app that uses Mistral AI to detect inappropriate or harmful text. Built with FastAPI and Streamlit, it flags content based on certain categories, supports custom "bad words," and masks PII information.

Notifications You must be signed in to change notification settings

farahsedd/safe-place-mini-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SafePlace

To make the internet a Safer Place.

A simple content moderation project built with Mistral models for assessing text content across several categories:

  • sexual content
  • hate and discrimination
  • violence and threats
  • dangerous and criminal content
  • selfharm content
  • health advice
  • financial advice
  • law advice
  • PII: Personal Identifiable Information

Project Structure

The project is divided into two folders:

  • Frontend: Contains the user interface and client-side logic.
  • Backend: Contains server-side logic, API endpoints, and integration with Mistral models.

Screenshots

Main UI toggle menu Screenshot of the UI.

Moderation Result Screenshot showing moderation results.


Setup and Installation

Prerequisites

Install dependencies:

pip install -r requirements.txt

Backend

  1. Navigate to the backend folder:

    cd backend
  2. Set up environment variables:

    • Create a .env file with the necessary API key.
    MISTRAL_API_KEY=***************
    
  3. Run the backend server:

    python -m uvicorn main:app --host 127.0.0.1 --port 8001 --reload

Frontend

  1. Navigate to the frontend folder:

    cd frontend
  2. Start the frontend server:

    streamlit run main.py

Open the frontend interface in your browser: http://localhost:8501

About

A mini content moderation project app that uses Mistral AI to detect inappropriate or harmful text. Built with FastAPI and Streamlit, it flags content based on certain categories, supports custom "bad words," and masks PII information.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages