我在Label Studio中输入了上千个图像,每个图像都是由.json定义的,如下所示:
[
{
"data": {
"image": "cometa_32742CRO000005502746_1500824468_2.png"
},
"predictions": [
{
"result": [
{
"value": {
"text": ["OLRIONI MAURO"]
},
"id": "fe83f7ed-2325-41a1-bc1c-2d46eeec899f",
"from_name": "question",
"to_name": "image",
"type": "textarea"
}
]
}
]
}
]我需要获得predictions->result->value->text参数,以便在标签序言中使用,如下所示:
<TextArea name="question" value=""> predictions->result->value->text </TextArea>我怎么能这么做?
发布于 2022-02-15 11:12:35
我建议使用数据中的变量,而不是预测来获得您描述的行为。
例如:
[
{
"data": {
"image": "/data/upload/47/fa12d6c8-dialogue-analysis.png",
"text" : "mario rossi"
}
}
]然后使用这样的标签配置:
<View>
<Choices name="handwritten" toName="handwritten" choice="single-radio" showInLine="true">
<Choice value="Maiuscolo" selected="true" hotkey="q"/>
<Choice value="Minuscolo" hotkey="w"/>
</Choices>
<TextArea name="question" toName="image" value="$text" editable="true"/>
<Image name="image" value="$image"/>
</View>注意:如果您尝试更新标签配置,而有些任务数据只包含图像数据,而不包含文本数据,您将无法保存更改。如果这是你的问题,让我知道,我可以分享我的解决办法。
这里有更多关于变量的信息:https://labelstud.io/tags/index.html#Variables
https://stackoverflow.com/questions/70773013
复制相似问题