Skip to content

Commit 5d43895

Browse files
feat: DOC-283: Add gallery templates from docs (#7184)
Co-authored-by: caitlinwheeless <[email protected]> Co-authored-by: robot-ci-heartex <[email protected]>
1 parent 0d52df6 commit 5d43895

File tree

4 files changed

+122
-1
lines changed
  • label_studio/annotation_templates

4 files changed

+122
-1
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
title: Medical Image Classification with Bounding Boxes
2+
type: community
3+
group: Computer Vision
4+
image: /static/templates/medical-image-classification.png
5+
details: <h1>Classify medical images and draw regions</h1>
6+
config: |
7+
<View>
8+
<Image name="image" value="$image"/>
9+
10+
<RectangleLabels name="label" toName="image">
11+
<Label value="Tumor" background="green"/>
12+
</RectangleLabels>
13+
14+
<Choices name="classification" toName="image">
15+
<Choice value="Benign"/>
16+
<Choice value="Malignant"/>
17+
<Choice value="Normal"/>
18+
</Choices>
19+
</View>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
title: LLM Response Grading
2+
type: community
3+
group: Generative AI
4+
order: 6
5+
image: /static/templates/response-grading.png
6+
details: Assign a grade to LLM responses based on how well it meets your internal guidelines.
7+
config: |
8+
<View>
9+
<Style>
10+
.root {
11+
font-family: Arial, sans-serif;
12+
margin: 0;
13+
padding: 0;
14+
display: flex;
15+
flex-direction: column;
16+
height: 100vh;
17+
}
18+
.container {
19+
display: flex;
20+
flex: 1;
21+
}
22+
.block {
23+
flex: 1;
24+
padding: 20px;
25+
box-sizing: border-box;
26+
}
27+
.scrollable {
28+
overflow-y: auto;
29+
height: calc(100vh - 80px); /* Adjust height to accommodate header and footer */
30+
}
31+
.long-document {
32+
background-color: #f9f9f9;
33+
border-right: 1px solid #ddd;
34+
}
35+
.short-summary {
36+
background-color: #f1f1f1;
37+
}
38+
.summary-rating {
39+
padding: 20px;
40+
background-color: #c3bcbc;
41+
border-top: 1px solid #ddd;
42+
text-align: center;
43+
}
44+
h2 {
45+
margin-top: 0;
46+
}
47+
</Style>
48+
49+
<View className="root">
50+
<View className="container">
51+
<View className="block long-document scrollable">
52+
<Header value="Long Document"/>
53+
<Text name="document" value="$document"/>
54+
</View>
55+
56+
<View className="block short-summary">
57+
<Header value="Short Summary"/>
58+
<Text name="summary" value="$summary"/>
59+
</View>
60+
</View>
61+
62+
<View className="summary-rating">
63+
<Header value="Rate the Document Summary:"/>
64+
<Rating name="rating" toName="summary" required="true"/>
65+
</View>
66+
</View>
67+
</View>
68+
69+
<!--{ "data" : {
70+
"document": [
71+
"Opossums, commonly known as possums in North America, are marsupials found primarily in the Americas. The most well-known species is the Virginia opossum (Didelphis virginiana), which ranges from Central America and the eastern United States to southern Canada. These adaptable creatures are known for their ability to thrive in a variety of environments, including both rural and urban areas. Opossums are also found in South America, where different species inhabit a range of ecosystems, from tropical rainforests to temperate forests.",
72+
"Opossums are highly adaptable in terms of habitat, often residing in woodlands, farmland, and even suburban backyards. They typically seek shelter in hollow trees, abandoned burrows, or any dark, enclosed space they can find. Opossums are nocturnal and omnivorous, with a diet that includes fruits, insects, small animals, and even carrion. Their opportunistic feeding habits contribute to their resilience and ability to live in close proximity to human settlements.",
73+
"In terms of behavior, opossums are solitary and nomadic, often moving to different locations in search of food. They are known for their unique defense mechanism of 'playing dead' or 'playing possum' when threatened, which involves mimicking the appearance and smell of a sick or dead animal to deter predators. Opossums have relatively short lifespans, typically living only 2 to 4 years in the wild. Despite their short lives, they reproduce quickly, with females giving birth to large litters of up to 20 young, although not all offspring typically survive to maturity.",
74+
"In popular culture, opossums often appear as symbols of resilience and survival due to their hardy nature and ability to adapt to various environments. They are sometimes depicted in a comical or misunderstood light, given their nocturnal habits and somewhat disheveled appearance. Despite this, they play a crucial role in the ecosystem by controlling insect and rodent populations and cleaning up carrion. Opossums have been featured in various forms of media, from cartoons and children's books to movies, often emphasizing their unique behaviors and survival strategies."
75+
],
76+
"summary": "Opossums, primarily found in the Americas, are adaptable marsupials known for thriving in diverse environments, from rural to urban areas. They are nocturnal and omnivorous, often seeking shelter in dark, enclosed spaces and employing a unique defense mechanism of 'playing dead' to deter predators. In popular culture, opossums symbolize resilience and survival, playing a crucial role in ecosystems by controlling insect and rodent populations and cleaning up carrion."
77+
}
78+
}
79+
-->
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
title: Content Moderation
2+
type: community
3+
group: Natural Language Processing
4+
image: /static/templates/content-moderation.png
5+
details: <h1>Content moderation</h1>
6+
config: |
7+
<View>
8+
<Text name="text" value="$text"/>
9+
10+
<Choices name="content_moderation" toName="text" choice="multiple" showInline="false">
11+
<Choice value="Toxic" background="red"/>
12+
<Choice value="Severely Toxic" background="brown"/>
13+
<Choice value="Obscene" background="green"/>
14+
<Choice value="Threat" background="blue"/>
15+
<Choice value="Insult" background="orange"/>
16+
<Choice value="Hate" background="grey"/>
17+
</Choices>
18+
19+
<View style="margin-top: 2em; box-shadow: 2px 12px 15px #999; padding: 30px; border-radius: 5px; background-color: #F0FFF0;">
20+
<Header value="Please provide additional comments"/>
21+
<TextArea name="comments" toName="text" required="false"/>
22+
</View>
23+
</View>

label_studio/annotation_templates/natural-language-processing/machine-translation/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ config: |
77
<View>
88
<View style="display: grid; grid-template: auto/1fr 1fr; column-gap: 1em">
99
<Header value="Read the sentence in English" />
10-
<Header value="Provide translaton in Spanish" />
10+
<Header value="Provide translation in Spanish" />
1111
1212
<Text name="english" value="$english" />
1313

0 commit comments

Comments
 (0)