본문으로 건너뛰기

훈련 단계

연습 항목, 정답이 정해진 문제, 즉각적인 피드백, 실제 작업에 들어갈 사람을 정하는 합격 기준으로 Potato에서 주석자의 자격을 확인합니다.

Potato에는 본 작업 전에 실행되는 선택적 훈련 단계가 있습니다. 주석자는 정답이 정해진 연습 문제에 답하고 문제마다 피드백을 받습니다. 그래서 지침을 잘못 이해한 부분이 코퍼스 전체로 퍼지기 전에 드러납니다.

훈련 단계가 주석자를 거르는 방식 — 정답이 알려진 항목으로 연습하고, 자격을 갖춘 주석자만 실제 작업에 도달훈련 단계가 주석자를 거르는 방식

사용 사례

  • 주석자가 작업을 이해했는지 확인
  • 요구하는 정확도에 미치지 못하는 주석자 걸러내기
  • 실제 주석 전에 안내가 있는 연습 제공
  • 풀이 예시로 지침 가르치기

작동 방식

  1. 주석자가 일련의 훈련 문제에 답합니다
  2. 답할 때마다 바로 피드백이 표시됩니다
  3. 진행 상황을 합격 기준에 비추어 측정합니다
  4. 합격한 주석자만 본 작업으로 넘어갑니다

재보정 라운드는 연구 도중에 주석자가 이 훈련 항목을 다시 풀도록 합니다.

구성

훈련에는 서로 다른 일을 하는 두 블록이 필요합니다. 최상위 training 블록은 단계를 구성하고, phases는 워크플로에서 그 단계가 놓일 위치를 정합니다. 둘 중 하나만 구성하는 것이 훈련 단계가 나타나지 않는 흔한 원인입니다.

training 블록

yaml
training:
  enabled: true
  data_file: "data/training_data.json"
  annotation_schemes: ["sentiment"]
  passing_criteria:
    min_correct: 3
    require_all_correct: false
  allow_retry: true
  failure_action: "repeat_training"

구성 옵션

옵션유형기본값설명
enabledbooleanfalse훈련 단계를 실행할지 여부
data_filestring-훈련 데이터의 경로이며 활성화하면 필수
annotation_schemeslist모든 스키마훈련 대상으로 삼을 스키마
passing_criteria.min_correctinteger훈련 항목 수합격에 필요한 정답 수
passing_criteria.require_all_correctbooleanfalse모든 문제를 맞혀야 하는지 여부
passing_criteria.max_mistakesinteger-1불합격이 되기까지 허용되는 전체 오답 수이며 -1은 제한 없음
passing_criteria.max_mistakes_per_questioninteger-1불합격이 되기까지 허용되는 한 문제의 오답 수
allow_retrybooleantrue틀린 답을 다시 시도할 수 있는지 여부
failure_actionstringmove_to_donemove_to_done 또는 repeat_training

annotation_schemes는 스키마 하나가 아니라 여러 스키마의 이름을 받으므로, 질문이 여럿인 작업은 모든 질문을 훈련할 수도 있고 문제가 되는 질문 하나만 훈련할 수도 있습니다.

워크플로에 단계 추가하기

phases는 워크플로 순서를 나열하고 각 단계가 가리키는 파일을 지정합니다. 훈련 항목에는 type과 file이 있으며, 위의 설정은 training 블록에 그대로 둡니다.

yaml
phases:
  order: [consent, instructions, training, annotation]
 
  consent:
    type: consent
    file: surveyflow/consent.json
 
  instructions:
    type: instructions
    file: surveyflow/instructions.html
 
  training:
    type: training
    file: data/training_data.json

annotation 단계는 프로젝트의 annotation_schemes를 쓰므로 파일이 필요 없습니다. 다른 단계는 다단계 워크플로를 참고하십시오.

합격 기준

기준은 조합할 수 있으므로, 정답 수의 하한을 요구하면서 같은 문제를 계속 틀리는 사람을 걸러낼 수도 있습니다.

최소 정답 수

yaml
passing_criteria:
  min_correct: 3

모두 정답 요구

yaml
passing_criteria:
  require_all_correct: true

최대 오답 수

yaml
passing_criteria:
  max_mistakes: 5

주석자는 전체 오답이 다섯 개가 되면 불합격합니다.

문제당 최대 오답 수

yaml
passing_criteria:
  max_mistakes_per_question: 2

주석자는 어느 한 문제에서 오답이 두 개가 되면 불합격합니다. 전반적으로 약한 사람이 아니라 한 가지 구분에서 막힌 사람을 가려냅니다.

기준 조합

yaml
passing_criteria:
  min_correct: 3
  max_mistakes: 5
  max_mistakes_per_question: 2

훈련 데이터 형식

훈련 데이터는 training_instances 목록이 있는 JSON 파일입니다. 각 인스턴스에는 텍스트, 스키마별 정답, 답이 틀렸을 때 보여 주는 선택적 설명이 들어 있습니다.

json
{
  "training_instances": [
    {
      "id": "train_1",
      "text": "I absolutely love this product! Best purchase ever!",
      "correct_answers": {
        "sentiment": "Positive"
      },
      "explanation": "Strong positive language: 'love' and 'best purchase'."
    },
    {
      "id": "train_2",
      "text": "This is the worst service I've ever experienced.",
      "correct_answers": {
        "sentiment": "Negative"
      },
      "explanation": "'Worst' and the complaint itself indicate negative sentiment."
    },
    {
      "id": "train_3",
      "text": "The package arrived on time.",
      "correct_answers": {
        "sentiment": "Neutral"
      },
      "explanation": "A factual statement with no evaluation attached."
    }
  ]
}

훈련 인스턴스 필드

필드유형필수설명
idstring예인스턴스의 고유 식별자
textstring예주석할 텍스트
correct_answersobject예스키마 이름을 정답 값에 대응시킴
explanationstring아니요답이 틀렸을 때 표시됨

정답 형식

correct_answers는 각 스키마가 만들어 내는 형태와 일치합니다.

json
{
  "sentiment": "Positive",
  "topic": ["emotion", "personal"],
  "rating": 4,
  "notes": "example response"
}

여러 스키마

스키마가 여럿이면 correct_answers 아래에 스키마마다 정답을 넣습니다. Potato는 항목마다 explanation 문자열 하나를 읽으므로, 설명 하나가 모든 스키마를 다룹니다.

json
{
  "id": "train_4",
  "text": "Apple announced new iPhone features yesterday.",
  "correct_answers": {
    "sentiment": "Neutral",
    "topic": "Technology"
  },
  "explanation": "A factual news statement about a technology product."
}

사용자 경험

훈련 흐름

  1. 주석자는 자신이 훈련 단계에 있다는 표시를 봅니다
  2. 질문이 실제 작업과 같은 주석 양식으로 표시됩니다
  3. 주석자가 답을 제출합니다
  4. 피드백이 바로 표시되며, 답이 틀렸으면 설명이, allow_retry가 켜져 있으면 다시 시도하는 옵션이 함께 나옵니다

피드백 표시

틀린 답을 하면 주석자는 훈련 데이터의 설명과 합격 기준에 비춘 자신의 진행 상황을 봅니다. 답을 되풀이하지 않고 규칙을 가르치는 설명을 쓰는 것이 이 단계를 운영할 가치를 만듭니다.

관리자 모니터링

훈련 통계는 관리자 대시보드에 주석자별로 표시되며, 합격 여부, 정답 수, 전체 시도 횟수, 합격률, 현재 풀고 있는 문제를 다룹니다.

같은 데이터를 관리자 API로도 얻을 수 있습니다.

text
GET /admin/api/annotators
GET /admin/user_state/{user_id}

예시: 감성 분석 훈련

yaml
annotation_task_name: "Sentiment Analysis"
task_dir: "."
port: 8000
 
data_files:
  - "data/reviews.json"
 
item_properties:
  id_key: id
  text_key: text
 
annotation_schemes:
  - annotation_type: radio
    name: sentiment
    description: "What is the sentiment of this review?"
    labels:
      - Positive
      - Negative
      - Neutral
    sequential_key_binding: true
 
training:
  enabled: true
  data_file: "data/training_data.json"
  annotation_schemes: ["sentiment"]
  passing_criteria:
    min_correct: 3
    require_all_correct: false
  allow_retry: true
  failure_action: "repeat_training"
 
phases:
  order: [training, annotation]
  training:
    type: training
    file: "data/training_data.json"
 
output_annotation_dir: "output/"
export_annotation_format: "jsonl"
 
user_config:
  allow_all_users: true

예시: NER 훈련

스팬 스키마도 같은 방식으로 훈련합니다. 정답은 문자 오프셋으로 주어진 스팬의 목록입니다.

yaml
annotation_schemes:
  - annotation_type: span
    name: entities
    description: "Highlight named entities"
    labels:
      - Person
      - Organization
      - Location
      - Date
 
training:
  enabled: true
  data_file: "data/ner_training.json"
  annotation_schemes: ["entities"]
  passing_criteria:
    min_correct: 2
  allow_retry: true
json
{
  "training_instances": [
    {
      "id": "train_1",
      "text": "Tim Cook announced that Apple will open a new store in New York on March 15.",
      "correct_answers": {
        "entities": [
          {"start": 0, "end": 8, "label": "Person"},
          {"start": 24, "end": 29, "label": "Organization"},
          {"start": 54, "end": 62, "label": "Location"},
          {"start": 66, "end": 74, "label": "Date"}
        ]
      },
      "explanation": "Tim Cook is a Person, Apple an Organization, New York a Location, March 15 a Date."
    }
  ]
}

모범 사례

간단하게 시작하기

경계 사례를 내놓기 전에 모호하지 않은 예시로 시작하십시오. 첫 문제에서 실패한 주석자는 자신이 실수했다는 사실이 아니라 작업이 혼란스럽다는 사실을 배웁니다.

모든 레이블을 다루기

스키마가 가질 수 있는 값마다 예시를 적어도 하나씩 넣으십시오. 훈련에 한 번도 나오지 않은 레이블이 주석자가 대규모로 틀리는 레이블입니다.

가르치는 설명 쓰기

설명은 답을 되풀이하지 말고 규칙을 알려 주어야 합니다.

json
{
  "explanation": "The review mentions a problem, but the reviewer is satisfied with how it was resolved, so the overall judgment is Positive rather than Negative."
}

도달할 수 있는 기준 정하기

엄격해서 문제없이 해냈을 주석자까지 잃기 쉬운 기준입니다.

yaml
passing_criteria:
  require_all_correct: true

피드백에서 배울 여유를 남기는 기준입니다.

yaml
passing_criteria:
  min_correct: 3
  max_mistakes_per_question: 2

경계 사례 포함하기

파일럿에서 의견이 갈린 예시를 넣으십시오. 지침이 정해야 하는 판단이 바로 그런 예시이기 때문입니다.

json
{
  "id": "train_5",
  "text": "Not bad at all, I guess it could be worse.",
  "correct_answers": {"sentiment": "Neutral"},
  "explanation": "Despite 'not bad' and 'worse', this is a lukewarm assessment rather than praise or complaint."
}

성능 고려 사항

훈련 데이터는 서버가 시작될 때 한 번 불러오고 훈련 상태는 나머지 사용자 상태와 함께 메모리에 보관되므로, 이 단계는 데이터베이스 요구 사항을 더하지 않고 본 작업에 측정 가능한 비용도 더하지 않습니다.

더 읽어보기

구현 세부 사항은 소스 문서를 참고하십시오.