https://github.com/farahsedd/safe-place-mini-project
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.
https://github.com/farahsedd/safe-place-mini-project
content-filtering content-moderation fastapi mistral-ai mistral-api regex streamlit streamlit-dashboard
Last synced: 2 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/farahsedd/safe-place-mini-project
- Owner: farahsedd
- Created: 2024-11-14T13:35:40.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-11-14T21:24:29.000Z (6 months ago)
- Last Synced: 2025-01-21T05:28:22.992Z (4 months ago)
- Topics: content-filtering, content-moderation, fastapi, mistral-ai, mistral-api, regex, streamlit, streamlit-dashboard
- Language: Python
- Homepage: https://safe-place.streamlit.app
- Size: 188 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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


*Screenshot of the UI.*
*Screenshot showing moderation results.*---
## Setup and Installation
### Prerequisites
**Install dependencies**:
```bash
pip install -r requirements.txt
```### Backend
1. **Navigate to the backend folder**:
```bash
cd backend
```3. **Set up environment variables**:
- Create a `.env` file with the necessary API key.
```
MISTRAL_API_KEY=***************
```4. **Run the backend server**:
```bash
python -m uvicorn main:app --host 127.0.0.1 --port 8001 --reload
```### Frontend
1. **Navigate to the frontend folder**:
```bash
cd frontend
```3. **Start the frontend server**:
```bash
streamlit run main.py
```*Open the frontend interface in your browser: http://localhost:8501*