Skip to content

文本标注

文本标注的完整指南,涵盖分类、多标签标注、评分与自由文本,以及如何用可直接复制的配置在 Potato 中搭建每一类文本任务。

文本标注是指为书面语言打标签:将文档归入类别、标出文章中的主题、就质量给一段文字评分,或写出一处修正。它是自然语言处理中最常见的标注任务,也是 Potato 最初为之打造的功能。 本指南讲解面向整篇文档的文本任务;要标记文本内部的区域,请参见跨度标注

文本任务一览

  • 文档分类:为整篇文本给出一个标签(文本分类)。
  • 多标签标注:一次给出多个标签,例如主题或内容警示。
  • 评分与打分:在一个量表上确定位置,例如质量或情感强度。
  • 自由文本:写下答案、改写或修正。

分类:每篇文档一个标签

文本标注的主力任务。当类别互斥时,使用 radio

yaml
annotation_schemes:
  - annotation_type: radio
    name: sentiment
    description: "What is the overall sentiment of this review?"
    labels: [Positive, Negative, Neutral]
    sequential_key_binding: true

sequential_key_binding 会把标签映射到 123 键,让标注者的手不离键盘。在成千上万个条目的任务中,这能带来很大的提速。可参考实时演示的情感分析设计,看一个可用的示例。

多标签:一次多个标签

当可以同时适用多个标签时,使用 multiselect。把可选数量限定在符合你的指南的范围内:

yaml
annotation_schemes:
  - annotation_type: multiselect
    name: content_warnings
    description: "Select every content warning that applies."
    labels: [Violence, Profanity, Sexual content, Self-harm, None]
    min_selections: 1
    max_selections: 5

内容审核是经典的多标签文本任务;毒性检测设计把一个类别与一段高亮的跨度结合在一起。

在量表上为文本评分

要刻画程度而非类别,使用李克特量表

yaml
annotation_schemes:
  - annotation_type: likert
    name: helpfulness
    description: "How helpful is this answer?"
    size: 5
    min_label: "Not helpful"
    max_label: "Very helpful"

关于量表设计的陷阱,例如默许偏差以及应使用多少个刻度,请参见评分量表

自由文本与修正

有时最有用的标签是标注者写下的一句话——一段说明、一次改写或一份转写。把它与一个类别结合,并只在相关时显示:

yaml
annotation_schemes:
  - annotation_type: radio
    name: factuality
    description: "Is the claim supported by the source?"
    labels: [Supported, Contradicted, Not enough info]
  - annotation_type: text
    name: evidence
    description: "Quote the sentence that supports your choice."
    label_requirement:
      required: false

获得一致的文本标签

文本是有歧义的,因此一致性来自周边的流程,而非界面本身:

  1. 撰写严谨的标注指南,并提供"无法判断"选项。
  2. 让多位标注者在同一批条目上重叠标注。
  3. 跟踪标注者间一致性,并裁定分歧。
  4. LLM 预标注加速大型任务,并人工核验这些建议。

延伸阅读