Adult Content [Text and Image] Filtering

Hey all,

I’ve been browsing the forums and trying to find a solid answer on how to limit NSFW language and images in an app.

I will be using a reporting system (as API’s cannot handle all cases) but I’m trying to limit users from putting offensive language in their biography and user profiles upon registration.

My only solution so far for text:

  • Creating a language list as a data-type and have it store a list of ‘bad words’ :slight_smile:.
  • When the user submits their profile, do a search to see if their profile has any words contained in the list
  • If yes, disable the registration button.

But the list of language is long and I’m not sure how this affects the app usage and/or if it will slow down the user experience.

Does anyone have any good solutions or APIs/Plugins they would recommend as an addition?

Image filtering I’m still exploring.

I found there is a github repo of many Obscene-and-Otherwise-Bad-Words.
This may help you in adding to your database.

Also I found someone created a node.js module, Aeods, that will detect foul language and return data that can be used determine whether or not to allow the words. If you create a Plugin and use a server side action you can use node.js and probably pass the text to the plugin and wait for the response before allowing the user to register.

I couldn’t find anything already built out though so sounds like some work to be done.

1 Like

Thanks for the repo link @williamtisdale

As a temporary solution

  1. Set a condition on an input field
  2. Condition: Do a Search for [Bad Language], if [Bad Language] Contains Input’s value.
  3. If Search count is greater than 0, Input is Invalid.

For my database - I created a [Bad Language] data type with a single record. That record was a list that contained all the “bad” words; found thanks to @williamtisdale link.

Help? This breaks as soon as there is a space between wording.

My current workflow is to search an input field for any offensive language based on a list of blacklisted words. If the the search returns a count greater than 0 - it sets a Y/N custom state [No if a match is found].

This works if there is only one word in the input field


image

But breaks as soon as another word or space is added. I tried to use the :split by expression but to no avail :frowning:
image

When you do ‘This MultilineInput’s value:split by (" ")’, you need to probably save the count as a custom state or have a repeating group with Type of Content ‘text’ and set the data source to ‘This MultilineInput’s value:split by (" ")’. That way you can have an element in each cell that checks that one specific word and if any of them are bad then it will let you know. Long story made short is you can’t say contains and then pass a list. You have to say contains for each single word.

1 Like

@williamtisdale Thank you! This is works great. 99% of the solution.

With an RG that splits each input into single items I was able to use the “is in” expression to do a comparison.

A last question on database setup for the offensive language:

  • Does the offensive language data have to be setup as a database of individual records for each offensive word (Word Single) or can it be setup as a single record with a list of words (Offensive Words List)?

I can’t get the validator to work when it’s comparing a list vs. the repeating groups list?

I was hoping to avoid storing 400+ individual records to help with the apps data storage.

Can a list be compared against another list?

Yes, but why would this be a bad thing?

@keith Not so much bad as it is frugal? lol

When it comes to Bubble’s database does it consider each item in a list as a record? or is the entire list one record?

i.e. in the screen shot…is the Offensive Word List considered to be 1 record or 3 records (one for each word separated by a comma).

image

If possible - I’d like to avoid creating 400 records/taking up 400 records in my database when I could cram it all into one?

In all seriousness: If you have a Thing that is unique and that Thing (“Offensive Words List”) is just a list of however many text items, that’s just 1 single Thing in the database.

Don’t get spun by Bubble’s dumb pricing proposal from earlier in the month. That won’t stand. (If they do implement that, certain people will delete everything helpful they’ve ever done for Bubble and fudge the whole thing up. So, just proceed.)

Doing stuff this way is very efficient. If there is only 1 item of a certain Thing type (let’s call it “Offensive Words List”) in your database, doing a Search for “All Offensive Word’s Lists: first item” to get at that list is almost as efficient as having that list already in memory.

1 Like

However, my joke stands: Why on earth would one filter naughty words? Naughty words make the world go around. Wasting CPU cycles on such things is like throwing aluminum cans on the ground. But that’s just MY opinion, [expletive deleted]. See what I did there?

1 Like

@keith So you’re saying create an application that only allows users to put in expletives :relieved:

I’m going to give this a try tonight. I wasn’t able to compare two lists against each other as the input fields for users contain multiple words.

I am able to store the user inputs into a group but cannot do “Offensive Word List” contains “User Input”.

Although; first item might be the expression I’ve been missing all along. I suppose it would always catch the first expletive no matter how many words/user inputs are added.

Going to give this a try @keith. Thanks.

Hey @keith

I’m not sure I’m fully understanding this.
Current setup:

In my database I have a unique thing “Offensive Language Store” that stores individual expletive’s.

On the front end users have multiple input fields they must fill in prior to registration. I have an RG (hidden) that stores every input as a single line. If that RG list contains a word that exists in the “Offensive Language Store” it unchecks a hidden element I have called the “Language Validator”. If the validator is unchecked they cannot submit.

I need help with translating this to a list.

If I have an RG that is holding every single input (which can have multiple words), how do I do a comparison of this list to the list of “Offensive Language” I have stored in the database.

I’ve attempted the “Search For Language Store: first item” but bubble returns an error.

This topic was automatically closed after 70 days. New replies are no longer allowed.