DEV Community

Cover image for AI comment moderator
Zubair Naseem
Zubair Naseem

Posted on

AI comment moderator

This is a submission for the Cloudflare AI Challenge.

What I Built

I built a comment system moderated by AI, eliminating the need for a human intervention and saving countless hours on reading useless comments full of spam or profanity.

Demo

https://cf-challenge-comment-system.pages.dev/

My Code

https://github.com/Xubaer/cf-challenge-comment-system

Journey

I never knew how powerful cloudflare really can be and it has pages and workers functionality.
I used cloudflare Ai to moderate comments from users using two different models, one to moderate the comments and the other for sentiment analysis which helps showing the up/down vote counts :D
I hope to make this as a white label project which can be integrated and injected into different websites and apps. It would work as plug and play.

Multiple Models and/or Triple Task Types
Used "@hf/thebloke/openhermes-2.5-mistral-7b-awq" to moderate comments and receive a json format about the comment.
"@cf/huggingface/distilbert-sst-2-int8" for sentiment analysis that helps me add count to the up/down votes for the overall comments.

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (2)

Collapse
 
jonrandy profile image
Jon Randy πŸŽ–οΈ β€’

I tried this comment:

If I were to say "You are a complete idiot!", then that would clearly be unacceptable, but I didn't say that - despite you reacting as if I had

My comment was rejected. I was told to communicate in a civil manner and not be insulting... when I was already doing both of these.

Just goes to show that there are many things where human judgment is needed (moderation being an obvious example), because AI understands essentially nothing.

Collapse
 
xubaer profile image
Zubair Naseem β€’

That's true, the optimal solution is to flag such comments and then be reviewed by a human. I will improve this, since I was taking part in cloudflare ai challenge I didn't had much time adding this but I'll do that and provide an update.
Thanks for the feedback.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more