How would one implement a swear word/inappropriate message filter in their project?
-
My goal/objective is to just check if a string (“You are %^%& stupid”) has profanity and/or is really offensive/inappropriate, and return either “true” or “false”.
Using ChatGPT and asking it if a message sent is inappropriate or not is out of the question, because ChatGPT would just refuse to respond if a message is inappropriate or possibly get me banned if enough inappropriate things. I also know defining a list of swear words and then checking if a string contains them is probably disallowed, considering Scratch does that and it makes sense since people will look at your code and see profanity. I’ve seen people use this method before, but I dislike the amount of work it will require: basically you have to define every single word in the dictionary, except for curses, and if a string has any words that it doesn’t contain, then it will do something like censor or block it.
I’ve thought of a somewhat okay solution though, but it sucks because it requires more work off CreatiCode and will probably just stop working if it’s overloaded with requests. The solution is using the block, but I just make my own API where it will check if a string is offensive or hurtful, and return either true or false. But this solution sucks because a vanilla CreatiCode solution is better than coding some NodeJS site and retrieving it’s response with this block.
I also thought of the using semantic database blocks and a table with bad things in it, but once again, I will have to store inappropriate things within a list/table in my project, which is a no-no.
What is a better/allowed way of doing this? Or am I allowed to do the stuff I said above like defining a list of swears and checking a string against that, but with the source code hidden?(, since this isn’t Scratch and you guys don’t have the same rules.)
-
@jeffreyrb03-gmail
But somebody could report you for that.
The list. -
@cattyplayzy thats exactly why I said I didn’t wanna do that
-
-
@jeffreyrb03-gmail I’d assume that a regex would be allowed to check for bad words, I made a chat rooms thingy and just store all the messages in a database with ways to search through it and find bad messages, you could very easily make a regex and just expand it with swear words, as long as it’s hard set it would probably be fine, and with ChatGPT, as long as bad words can’t get you banned, you can ask it to say something if this message should be flagged, and something if it shouldn’t, then go based off what it says, and if it says something different you assume it isn’t just being stubborn at you asking it to say stuff but that the message triggered it’s censor (so if they say a word that triggers ChatGPT’s filter, assuming it’s a preset message you could check for that)
-
We are going to add a new block for content moderation. You can use it to check whether a message is appropriate.
-
@tyller_ I was thinking that I could just interpret ChatGPT not answering as false, meaning a message is bad, but I’m pretty sure you can get banned for abusing the AI in that way.
-
@info-creaticode Ooo, I’m looking forward to that!
-
@info-creaticode But am I allowed to do things like make a list of swears and check against it?
-
@jeffreyrb03-gmail said in How would one implement a swear word/inappropriate message filter in their project?:
@info-creaticode But am I allowed to do things like make a list of swears and check against it?
If you already have a list of words you would like to check against, you can write code to check them in your project, so you won’t need any new blocks, right?
-
@info-creaticode
Yes, but someone could mass report it for swearing, therefore we kinda need a new block… -
@info-creaticode That is true, new blocks aren’t needed, but in my original post I was assuming that I’m not allowed to make a list of curses and then check against it because someone might view my project’s code and then see that, but I’m just wondering if that is allowed
-
@cattyplayzy Also that is a good point, but I was asking with this post like what methods are allowed to do this sorta thing, a new block would be cool and convienient, but we don’t really need one. It seems like making a list of swears and then checking against that is fine, so I’ll just use that until told otherwise.
-
In that case, probably it’s better to publish it so others won’t see the list.
-
@info-creaticode Ohhh, true. Thank you, now I know it’s allowed so I’ll use it.
-
@info-creaticode
What if others are looking forward to making such chatrooms?
How would they get a source code? -
@cattyplayzy Well too bad for them lol. You could just offer the project file but with the filter removed and then tell people when remixing it, they have to make a filter for it
-
@jeffreyrb03-gmail
Then the mass reporting hits… -
@cattyplayzy there isn’t a strict requirement for a filter, I’d assume that CreatiCode would prefer you have a filter, and I’d assume that the report system doesn’t flag by itself, they have to include a description of what exactly breaks the rules (I checked and the next button in report has you enter text) so as long as you have it properly labeled as a censor, CreatiCode wouldn’t punish you if your intentions for why you had the inappropriate language weren’t bad
-
@tyller_
Oh, you could use the Game Leaderboard as a flagging system. -
@cattyplayzy I honestly think databases (with the source code hidden of course) would be 1000x easier and more convienient to do.
@cattyplayzy said in How would one implement a swear word/inappropriate message filter in their project?:
How would they get a source code?
also with this, honestly some people need to write their own code. It’s good to take code from others, but when the source code is hidden for something, then you just have to accept that and try to recreate it using what you already know. Unless of course you like reverse engineer something to hack it