The Pekoda AI Service is a Python-based service designed to provide AI-powered content moderation for the Pekoda ecosystem. It detects and censors sensitive text and media content (e.g., in posts and comments) to ensure a safe user experience on the platform.
This service integrates with the main Golang backend and uses machine learning models to analyze content. It leverages PyTorch and HuggingFace Transformers for text and media detection.
The AI Service is responsible for:
It communicates with the main Golang backend in two ways:
The Python server provides the following content moderation functions:
*). For example, a comment like "This is offensive content" might be censored as "This is ******** content" if "offensive" is flagged.Clone the Repository
git clone https://github.com/phuongnlh/social_media_ai_service.git
cd social_media_ai_service
Create Configuration File
config folder in the root directory.dev.yaml or prod.yaml with the following content (fill in any private data):
server:
port: 5000
rabbitmq:
url: "amqp://guest:guest@localhost:5672/"
username: "guest"
password: "guest"
vhost: "/"
connection_timeout: 10
max_reconnect_attempts: 5
comment_censor_grpc_conn:
port: 50051
host: localhost
Set Up Virtual Environment
python -m venv venv
venv\Scripts\activate
source venv/bin/activate
Install Dependencies
requirements.txt:
pip install -r requirements.txt
Run the Server
make dev
make prod
comment_censor_grpc_conn settings must match the Golang backend's gRPC configuration for successful communication.make dev or make prod).The Pekoda AI Service is a Python-based service designed to provide AI-powered content moderation for the Pekoda ecosystem. It detects and censors sensitive text and media content (e.g., in posts and comments) to ensure a safe user experience on the platform.
This service integrates with the main Golang backend and uses machine learning models to analyze content. It leverages PyTorch and HuggingFace Transformers for text and media detection.
The AI Service is responsible for:
It communicates with the main Golang backend in two ways:
The Python server provides the following content moderation functions:
*). For example, a comment like "This is offensive content" might be censored as "This is ******** content" if "offensive" is flagged.Clone the Repository
git clone https://github.com/phuongnlh/social_media_ai_service.git
cd social_media_ai_service
Create Configuration File
config folder in the root directory.dev.yaml or prod.yaml with the following content (fill in any private data):
server:
port: 5000
rabbitmq:
url: "amqp://guest:guest@localhost:5672/"
username: "guest"
password: "guest"
vhost: "/"
connection_timeout: 10
max_reconnect_attempts: 5
comment_censor_grpc_conn:
port: 50051
host: localhost
Set Up Virtual Environment
python -m venv venv
venv\Scripts\activate
source venv/bin/activate
Install Dependencies
requirements.txt:
pip install -r requirements.txt
Run the Server
make dev
make prod
comment_censor_grpc_conn settings must match the Golang backend's gRPC configuration for successful communication.make dev or make prod).