Skip to content

naumovmag/Moderator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text moderation microservice

Description

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.

Installation and Setup

To work with the microservice, it is recommended to create a virtual environment to avoid dependency conflicts. Follow these steps:

  1. Clone the repository:

    git clone https://github.com/naumovmag/Moderator.git
    cd Moderator
  2. Create a virtual environment and activate it:

    python -m venv venv

    For Linux/MacOS

    source venv/bin/activate

    For Windows

    venv\Scripts�ctivate
  3. Install the dependencies:

    pip install -r requirements.txt

Running Locally

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

Using Docker Compose

For convenient deployment, you can use Docker Compose.

  1. First, make sure you have Docker and Docker Compose installed.

  2. Build the Docker image and start the container:

    docker-compose up --build
  3. After successful startup, the microservice will be available at: http://localhost:5050

API Request Examples

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.

License

This project is distributed under the MIT license. Details can be found in the LICENSE file.

About

Microservice for text moderation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published