{"id":23084720,"url":"https://github.com/tutortoise/bilingual-abusive-detection-service","last_synced_at":"2026-02-08T17:32:49.716Z","repository":{"id":266192776,"uuid":"897519372","full_name":"Tutortoise/bilingual-abusive-detection-service","owner":"Tutortoise","description":"Text based content moderation service","archived":false,"fork":false,"pushed_at":"2024-12-12T00:47:57.000Z","size":5173,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T15:27:24.440Z","etag":null,"topics":["tensorflow","transformer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tutortoise.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-02T19:14:18.000Z","updated_at":"2024-12-12T00:48:01.000Z","dependencies_parsed_at":"2024-12-03T03:30:56.657Z","dependency_job_id":"dc439101-e9c3-4832-9498-4153fd7b90d1","html_url":"https://github.com/Tutortoise/bilingual-abusive-detection-service","commit_stats":null,"previous_names":["tutortoise/bilingual-abusive-detection-service"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tutortoise%2Fbilingual-abusive-detection-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tutortoise%2Fbilingual-abusive-detection-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tutortoise%2Fbilingual-abusive-detection-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tutortoise%2Fbilingual-abusive-detection-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tutortoise","download_url":"https://codeload.github.com/Tutortoise/bilingual-abusive-detection-service/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251731094,"owners_count":21634504,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["tensorflow","transformer"],"created_at":"2024-12-16T16:42:48.333Z","updated_at":"2026-02-08T17:32:49.676Z","avatar_url":"https://github.com/Tutortoise.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bilingual Abusive Text Detection Engine\n\n![Abusive Text Detection Engine](./architecture.jpg)\n\nA content moderation engine designed to maintain professional standards in our tutor-finding platform. Supports both English and Indonesian languages.\n\n## Overview\n\nThis engine provides enterprise-grade content moderation capabilities:\n\n- Real-time detection of inappropriate content\n- Multilingual support (English and Indonesian)\n- High-precision text classification\n- Scalable architecture for production deployment\n- Production-ready API endpoints\n- Comprehensive batch processing capabilities\n\n## Key Features\n\n### Content Analysis\n\n- Multi-language support (EN/ID)\n- Character substitution detection\n- Context-aware classification\n- Pattern recognition for evasion attempts\n- Real-time content validation\n\n### Technical Capabilities\n\n- Low-latency response times (\u003c100ms)\n- High-throughput batch processing\n- Scalable worker configuration\n- Configurable confidence thresholds\n- Comprehensive logging and monitoring\n\n## Technical Stack\n\n- **Runtime**: Python 3.11+\n- **Framework**: FastAPI\n- **Server**: Granian (High-performance ASGI server)\n- **ML Framework**: TensorFlow 2.x\n- **Package Management**: UV\n\n## Installation\n\n### Using Docker (Recommended)\n\n```bash\n# Build the image\ndocker build -t abusive-detection:latest .\n\n# Run the container\ndocker run -d -p 8000:8000 abusive-detection:latest\n```\n\n### Manual Installation\n\n```bash\n# Install dependencies\nuv sync\n\n# Start the server\ngranian web.main:app \\\n    --host 0.0.0.0 \\\n    --port 8000 \\\n    --interface asgi \\\n    --workers $(nproc)\n```\n\n## Configuration\n\n### Environment Variables\n\n| Variable                   | Description          | Default   |\n| -------------------------- | -------------------- | --------- |\n| `GRANIAN_HOST`             | Server host          | `0.0.0.0` |\n| `GRANIAN_PORT`             | Server port          | `8000`    |\n| `GRANIAN_WORKERS_PER_CORE` | Workers per CPU core | `2`       |\n| `GRANIAN_MAX_WORKERS`      | Maximum worker limit | `32`      |\n| `GRANIAN_LOG_LEVEL`        | Logging verbosity    | `info`    |\n\n## API Reference\n\n### Single Text Analysis\n\n```http\nPOST /predict\nContent-Type: application/json\n\n{\n    \"text\": \"Content to analyze\"\n}\n```\n\n### Batch Analysis\n\n```http\nPOST /predict_batch\nContent-Type: application/json\n\n{\n    \"texts\": [\n        \"First content to analyze\",\n        \"Second content to analyze\"\n    ]\n}\n```\n\n### Response Schema\n\n```typescript\ninterface PredictionResponse {\n  text: string;\n  probability: float; // Range: 0-1\n  is_abusive: boolean;\n  confidence: float; // Range: 0-1\n  early_detection: boolean;\n  matched_words: string[];\n}\n```\n\n### Example Response\n\n```json\n{\n  \"text\": \"Sample text for analysis\",\n  \"probability\": 0.12,\n  \"is_abusive\": false,\n  \"confidence\": 0.88,\n  \"early_detection\": false,\n  \"matched_words\": []\n}\n```\n\n## Model Training\n\n### Datasets\n\n- **English**: [Hate Speech and Offensive Language Detection](https://www.kaggle.com/datasets/thedevastator/hate-speech-and-offensive-language-detection/data)\n- **Indonesian**: [Indonesian Abusive and Hate Speech Twitter Text](https://www.kaggle.com/datasets/ilhamfp31/indonesian-abusive-and-hate-speech-twitter-text/data)\n\n## Health Monitoring\n\n```http\nGET /health\n```\n\nReturns service health status and basic metrics.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftutortoise%2Fbilingual-abusive-detection-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftutortoise%2Fbilingual-abusive-detection-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftutortoise%2Fbilingual-abusive-detection-service/lists"}