classifai
classifai copied to clipboard
Add support for Watson Sentiment Analysis in Comment Moderation
Is your enhancement related to a problem? Please describe.
When IBM Watson is selected as the comment moderation provider, enable support for Watson’s Sentiment API. This evaluates comments with a sentiment score between -1.0 (very negative) and +1.0 (very positive), and flags them accordingly.
New settings should be added:
- A toggle to enable sentiment scoring
- A threshold field to configure the minimum score required (e.g., 0.5)
- A dropdown to determine what happens when the score is below the threshold:
- Reject comment
- Hold for moderation (default)
- Allow with warning/logging
The UI should explain the scoring scale and include a link to IBM's documentation. The feature should integrate into the existing comment moderation engine and logging, respecting the selected provider.
Designs
This enhancement allows Watson users to moderate comments using sentiment analysis, supporting brands or communities that wish to promote constructive, positive discussion. It also provides parity with the OpenAI moderation provider while offering a different flavor of moderation logic.
Describe alternatives you've considered
- IBM Watson Sentiment Docs: https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-about#sentiment
- Could reuse existing provider logic patterns as seen in OpenAI integration
- Should support logging sentiment score with moderation result
- UI should follow the style of other provider-specific features in ClassifAI
- Could extend in future to include Watson's targeted sentiment capability
Code of Conduct
- [x] I agree to follow this project's Code of Conduct