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
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.
Screenshot showing moderation results.
Install dependencies:
pip install -r requirements.txt
-
Navigate to the backend folder:
cd backend
-
Set up environment variables:
- Create a
.env
file with the necessary API key.
MISTRAL_API_KEY=***************
- Create a
-
Run the backend server:
python -m uvicorn main:app --host 127.0.0.1 --port 8001 --reload
-
Navigate to the frontend folder:
cd frontend
-
Start the frontend server:
streamlit run main.py
Open the frontend interface in your browser: http://localhost:8501