This microservice performs text moderation, checking for prohibited content. It is primarily oriented towards the Russian language. It uses a pre-trained AI model for effective moderation. The service is written in Python and uses modern technologies for ease of use and deployment.
To work with the microservice, it is recommended to create a virtual environment to avoid dependency conflicts. Follow these steps:
-
Clone the repository:
git clone https://github.com/naumovmag/Moderator.git cd Moderator
-
Create a virtual environment and activate it:
python -m venv venv
For Linux/MacOS
source venv/bin/activate
For Windows
venv\Scripts�ctivate
-
Install the dependencies:
pip install -r requirements.txt
After installing the dependencies, install the dependencies from requirements.txt:
pip install -r requirements.txt
After installing the dependencies, you can run the microservice locally:
python app.py
For convenient deployment, you can use Docker Compose.
-
First, make sure you have Docker and Docker Compose installed.
-
Build the Docker image and start the container:
docker-compose up --build
-
After successful startup, the microservice will be available at:
http://localhost:5050
The microservice provides an API for text moderation. Example request to check text using cURL:
curl -X POST http://localhost:5050/moderate -H "Content-Type: application/json" -d '{"text": "Text for moderation"}'
The response will contain the result of text moderation.
This project is distributed under the MIT license. Details can be found in the LICENSE file.