doccano 在标签字段中包含注解者名称或唯一ID,

l2osamch  于 2个月前  发布在  其他
关注(0)|答案(3)|浏览(46)

功能描述

当在单个项目上导出多个注解者所做的注解时,无法区分谁做了哪个注解。这将使项目更集中于下游任务。
我注意到,在管理面板中,用户ID与跨度关联,但在数据导出中没有。

qybjjes1

qybjjes11#

你会写你的环境吗?谢谢!

o7jaxewo

o7jaxewo3#

class Labels(abc.ABC):
    label_class = ExportedLabel
    column = "labels"
    fields: Tuple[str, ...] = ("example", "label")  # To boost performance

    def __init__(self, examples: QuerySet[ExportedExample], user=None):
        self.label_groups = defaultdict(list)
        labels = self.label_class.objects.filter(example__in=examples)
        if user:
            labels = labels.filter(user=user)
        for label in labels.select_related(*self.fields):
            self.label_groups[label.example.id].append(label)

    def find_by(self, example_id: int) -> Dict[str, List[ExportedLabel]]:
        return {self.column: self.label_groups[example_id]}

这似乎以用户二进制的形式存在,但在/admin/或UI中找不到任何设置来激活它。

相关问题