Skip to content

Commit 09fc2cb

Browse files
caitlinwheelesscaitlinwheeless
and
caitlinwheeless
authored
docs: DOC-273: New template for content moderation (#6947)
Co-authored-by: caitlinwheeless <[email protected]> Co-authored-by: caitlinwheeless <[email protected]>
1 parent 377962c commit 09fc2cb

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: Content Moderation
3+
type: templates
4+
category: Natural Language Processing
5+
cat: natural-language-processing
6+
order: 209
7+
meta_title: Content Moderation Labeling Template
8+
meta_description: Template for performing content moderation labeling tasks.
9+
---
10+
11+
<img src="/images/templates/content-moderation.png" alt="" class="gif-border" width="552px" />
12+
13+
You can use this template for a content moderation project.
14+
15+
This template displays text from your source data, and then allows an annotator to pick any combination of content moderation labels. If the pre-configured options are not sufficient, they can add context or comments in the provided text area.
16+
17+
## Labeling configuration
18+
19+
```xml
20+
<View>
21+
<Text name="text" value="$text"/>
22+
<Choices name="content_moderation" toName="text" choice="multiple" showInline="false">
23+
<Choice value="Toxic" background="red"/>
24+
<Choice value="Severely Toxic" background="brown"/>
25+
<Choice value="Obscene" background="green"/>
26+
<Choice value="Threat" background="blue"/>
27+
<Choice value="Insult" background="orange"/>
28+
<Choice value="Hate" background="grey"/>
29+
</Choices>
30+
<View style="margin-top: 2em; box-shadow: 2px 12px 15px #999; padding: 30px; border-radius: 5px; background-color: #F0FFF0;">
31+
<Header value="Please provide additional comments"/>
32+
<TextArea name="comments" toName="text" required="false"/>
33+
</View>
34+
</View>
35+
```
36+
37+
## About the labeling configuration
38+
39+
#### Text
40+
41+
```xml
42+
<Text name="text" value="$text"/>
43+
```
44+
45+
This displays the text that needs moderation. There are multiple ways to import text files. See the [Text tag documentation](/tags/text.html) and our [import documentation](/guide/tasks#Types-of-data-you-can-import-into-Label-Studio).
46+
47+
#### Choices
48+
49+
```xml
50+
<Choices name="content_moderation" toName="text" choice="multiple" showInline="false">
51+
<Choice value="Toxic" background="red"/>
52+
<Choice value="Severely Toxic" background="brown"/>
53+
<Choice value="Obscene" background="green"/>
54+
<Choice value="Threat" background="blue"/>
55+
<Choice value="Insult" background="orange"/>
56+
<Choice value="Hate" background="grey"/>
57+
</Choices>
58+
```
59+
60+
The <Choices> tag provides a set of six class labels for the text. Because `choice="multiple"`, annotators can select more than one label if they apply. The `showInline="false"` parameter puts each option on a separate line rather than side-by-side.
61+
62+
63+
#### Text area
64+
65+
```xml
66+
<TextArea name="comments" toName="text" required="false"/>
67+
```
68+
69+
The text area block (wrapped in a styled `<View>`) prompts annotators for optional comments on why they picked certain labels or any other observations they want to add.
70+
71+
72+
## Related tags
73+
74+
- [Text](/tags/text.html)
75+
- [Choices](/tags/choices.html)
76+
- [TextArea](/tags/textarea.html)

docs/source/templates/gallery_nlp.ejs

+6
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,10 @@ cards:
5454
image: "/images/templates/machine-translation.png"
5555
url: "/templates/machine_translation.html"
5656

57+
- title: Content Moderation
58+
categories:
59+
- text classification
60+
image: "/images/templates/content-moderation.png"
61+
url: "/templates/content_moderation.html"
62+
5763
---
Loading

0 commit comments

Comments
 (0)