freema/perspective-api-bundle
Symfony bundle for Google's Perspective API that scores text for toxicity and abusive language. Gives moderators a simple service to check comments and user-generated content, with configurable thresholds for filtering or flagging harmful posts in your app.
Adopt when:
Look elsewhere or think twice when:
For executives (one paragraph): We can add toxicity detection to our user-generated content in days rather than a quarter by integrating Google's Perspective API through a small, low-commitment Laravel wrapper. It gives us risk-tiered moderation — flag, rank down, queue for review — without building ML. The cost is a metered third-party API and an access-approval step. The vendor lock-in is minimal because the wrapper is thin and swappable. Recommendation: pilot in log-only mode on one surface to measure baseline toxicity and false-positive rate, then decide on automated interventions with real data.
For engineering (the practical case): The package is a config-driven client for the Perspective API with a service-layer entry point. Release 1.2 adds support for custom HTTP client options — the thing that makes it deployable: explicit timeouts, bounded retries with backoff, proxy support for regional egress, and injectable/mockable transports for tests. Integration is a config block plus a service call returning attribute scores. Recommended pattern: dispatch scoring to a queue, persist scores alongside content, and keep the provider behind an internal ModerationScorer interface so thresholds, fallbacks, and provider swaps don't leak into product code. Two caveats to plan for: third-party latency and availability must not block writes, and thresholds need tuning against a labeled sample before any automated action ships.
How can I help you explore Laravel packages today?