标签
Labels标签为机器学习和数据科学项目中的任务区域标注提供了一组标签。使用Labels标签可以创建一组可分配给已识别区域的标签,并指定要分配给区域的标签值。
所有类型的标签都可以动态加载任务中的标签值。该任务数据应包含一个选项列表,用于创建底层的标签。选项中的所有参数都将传递到对应的标签中。
Labels标签可用于音频和文本数据类型。其他数据类型有特定于该类型的Labels标签。
参数
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| name | string |
Name of the element | |
| toName | string |
Name of the element that you want to label | |
| [choice] | single | multiple |
single |
Configure whether you can select one or multiple labels for a region |
| [maxUsages] | number |
Maximum number of times a label can be used per task | |
| [showInline] | boolean |
true |
Whether to show labels in the same visual line |
| [opacity] | float |
0.6 |
Opacity of rectangle highlighting the label |
| [fillColor] | string |
Rectangle fill color in hexadecimal | |
| [strokeColor] | string |
"#f48a42" |
Stroke color in hexadecimal |
| [strokeWidth] | number |
1 |
Width of the stroke |
| [value] | string |
Task data field containing a list of dynamically loaded labels (see example below) |
示例
基础标注配置,用于对文本段落应用标签
<View>
<Labels name="type" toName="txt-1">
<Label alias="B" value="Brand" />
<Label alias="P" value="Product" />
</Labels>
<Text name="txt-1" value="$text" />
</View>
示例 (这部分配置包含动态标签)
<Labels name="product" toName="shelf" value="$brands" />
<!-- {
"data": {
"brands": [
{ "value": "Big brand" },
{ "value": "Another brand", "background": "orange" },
{ "value": "Local brand" },
{ "value": "Green brand", "alias": "Eco", showalias: true }
]
}
} -->
示例 (等同于以下配置)
<Labels name="product" toName="shelf">
<Label value="Big brand" />
<Label value="Another brand" background="orange" />
<Label value="Local brand" />
<Label value="Green brand" alias="Eco" showAlias="true" />
</Labels>