A high-throughput, real-time sentiment analysis system for Arabic chat messages.
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management
cd sentiment-service
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Create sample dataset
python training/download_datasets.py
# Run worker (in mock mode without trained model)
python -m app.worker
cd ../romanh
bundle install
rails db:migrate
# Add to .env
SENTIMENT_SERVICE_ENABLED=true
RABBITMQ_URL=amqp://guest:guest@localhost:5672
Rails App (romanh) RabbitMQ Sentiment Service
┌─────────────────┐ ┌─────────┐ ┌─────────────────┐
│ Message Created │───────▶│analyze │────────▶│ Python Worker │
│ │ │ │ │ (ONNX Model) │
│ Update Message │◀───────│result │◀────────│ │
│ Action Cable │ └─────────┘ └─────────────────┘
└─────────────────┘
cd sentiment-service
source venv/bin/activate
# 1. Download datasets
python training/download_datasets.py
# 2. Preprocess
python training/preprocessing.py --split
# 3. Train (requires GPU)
python training/train.py --config training/config.yaml
# 4. Export to ONNX
python training/export_onnx.py --checkpoint models/checkpoints/bert-base-arabertv02_best --output models/sentiment_ensemble.onnx
# Health check
curl http://localhost:8000/health
# Predict sentiment
curl -X POST http://localhost:8000/predict \
-H "Content-Type: application/json" \
-d '{"text": "شكراً جداً، خدمة ممتازة!"}'
cd sentiment-service
docker-compose up -d
A high-throughput, real-time sentiment analysis system for Arabic chat messages.
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management
cd sentiment-service
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Create sample dataset
python training/download_datasets.py
# Run worker (in mock mode without trained model)
python -m app.worker
cd ../romanh
bundle install
rails db:migrate
# Add to .env
SENTIMENT_SERVICE_ENABLED=true
RABBITMQ_URL=amqp://guest:guest@localhost:5672
Rails App (romanh) RabbitMQ Sentiment Service
┌─────────────────┐ ┌─────────┐ ┌─────────────────┐
│ Message Created │───────▶│analyze │────────▶│ Python Worker │
│ │ │ │ │ (ONNX Model) │
│ Update Message │◀───────│result │◀────────│ │
│ Action Cable │ └─────────┘ └─────────────────┘
└─────────────────┘
cd sentiment-service
source venv/bin/activate
# 1. Download datasets
python training/download_datasets.py
# 2. Preprocess
python training/preprocessing.py --split
# 3. Train (requires GPU)
python training/train.py --config training/config.yaml
# 4. Export to ONNX
python training/export_onnx.py --checkpoint models/checkpoints/bert-base-arabertv02_best --output models/sentiment_ensemble.onnx
# Health check
curl http://localhost:8000/health
# Predict sentiment
curl -X POST http://localhost:8000/predict \
-H "Content-Type: application/json" \
-d '{"text": "شكراً جداً، خدمة ممتازة!"}'
cd sentiment-service
docker-compose up -d