As we rely more on online interactions, content moderation has taken on many different forms. From audio transcription to text and image processing, there’s more content than ever that needs to be reviewed. As you build your models, you want to make sure that you’re adhering to your content moderation guidelines. How can you ensure that your annotators are following the rules you’ve set out?
Enter Plugins from Label Studio. With Plugins, you can build in real-time content moderation to your annotation projects to ensure that annotators aren’t using words that are prohibited by your standards. In this tutorial, we’ll show you how.
The first thing you’ll do is create your project as you usually do, adding any data you have and any labeling config that you need. For this example, we’ll use the Labeling Config and sample data found in the plugin documentation.
Then, head to your Project Settings, go to Labeling Interface, and click on the Plugins tab at the top of the screen.
With Plugins, you can code any JavaScript that you’d like to work on a task by task basis as your annotators work. To help you get started, we’ve provided a set of out of the box plugins, including one for content moderation. To find it, click on the Insert Plugin dropdown menu on the top left of the JavaScript coding box, and select Simple Content Moderation. This will automatically insert the code you need into the code editing window!
Out of the box, the code looks to see if the TextArea tag contains the word “hate," which is disallowed in this example. If you wanted to extend the list of disallowed words or phrases, you could edit the code in the editor to reflect your standards. You could simply change the word “hate” to something else, or you could do a more substantial overhaul of the code to look inside a list of disallowed words and phrases. With Plugins, the world is your oyster.
If the disallowed word is found in the TextArea, an error message will pop up that says that the word “hate” is disallowed and the user will be prevented from saving.
Note: There is a known limitation with this Simple Content Moderation plugin example as it's written. It only works the first time the plugin is used on a given task - if a disallowed word is used twice in a row on the same task, the annotation will pass through. You should think of this plugin as helpful guidance for annotators but it's not perfect for strict enforcement.
To test your plugin, simply click the “run plugin” button at the bottom of the code editing window and create an annotation in the Preview window. Then, from the dropdown menu in the testing window, select “submit annotation” and click trigger. This will simulate the annotation that you made in the preview being submitted. Then, you’ll see the error message pop up!
That’s it! You just added simple content moderation to your project in a matter of minutes.
Ready to try Plugins for yourself? Talk to us to enable Plugins on your Label Studio Enterprise account, or check out our Plugins Gallery for more inspiration!
Happy Labeling!