Skip to content

대화 어노테이션

Potato에서 턴별 평가, 스팬 레이블, 맞춤형 표시로 대화를 어노테이션합니다. 다중 화자 대화, 채팅 기록, 스레드 답글을 지원합니다.

Potato는 각 인스턴스가 텍스트 요소의 목록을 포함하는 다중 항목 데이터의 어노테이션을 지원합니다. 이는 일반적으로 다음 용도에 사용됩니다.

  • 대화 어노테이션: 여러 턴으로 이루어진 대화
  • 쌍대 비교: 두 개 이상의 텍스트 변형 비교
  • 다중 문서 작업: 관련된 여러 텍스트를 평가하거나 레이블링하기

데이터 형식

입력 데이터

다중 항목 데이터는 text 필드 안의 문자열 목록으로 표현됩니다.

json
{"id": "conv_001", "text": ["Tom: Isn't this awesome?!", "Sam: Yes! I like you!", "Tom: Great!", "Sam: Awesome! Let's party!"]}
{"id": "conv_002", "text": ["Tom: I am so sorry for that", "Sam: No worries", "Tom: Thanks for your understanding!"]}

목록의 각 문자열은 하나의 항목(예: 대화 턴, 문서 변형)을 나타냅니다.

구성

기본 설정

yaml
# Data configuration
data_files:
  - data/dialogues.json
 
item_properties:
  id_key: id
  text_key: text
 
# Configure list display
list_as_text:
  text_list_prefix_type: none  # No prefix since speaker names are in text
  alternating_shading: true    # Shade every other turn for readability
 
# Annotation schemes
annotation_schemes:
  - annotation_type: radio
    name: sentiment
    description: "What is the overall sentiment of this conversation?"
    labels:
      - positive
      - neutral
      - negative

표시 옵션

list_as_text 구성은 목록 항목이 어떻게 표시되는지 제어합니다.

yaml
list_as_text:
  text_list_prefix_type: alphabet  # Prefix type for items
  horizontal: false                # Layout direction
  alternating_shading: false       # Shade alternate turns

접두사 유형

옵션예시적합한 경우
alphabetA. B. C.쌍대 비교, 선택지
number1. 2. 3.순차적 턴, 정렬된 목록
bullet. . .순서 없는 항목
none(접두사 없음)화자 이름이 텍스트에 포함된 대화

레이아웃 옵션

옵션설명
horizontal: false세로 레이아웃(기본값) - 항목이 위아래로 쌓임
horizontal: true나란히 배치하는 레이아웃 - 쌍대 비교용
alternating_shading: true대화의 턴을 번갈아 음영 처리

구성 예시

대화 어노테이션

yaml
annotation_task_name: Dialogue Analysis
 
data_files:
  - data/dialogues.json
 
item_properties:
  id_key: id
  text_key: text
 
list_as_text:
  text_list_prefix_type: none
  alternating_shading: true
 
annotation_schemes:
  - annotation_type: span
    name: certainty
    description: Highlight phrases expressing certainty or uncertainty
    labels:
      - certain
      - uncertain
    sequential_key_binding: true
 
  - annotation_type: radio
    name: sentiment
    description: What sentiment does the conversation hold?
    labels:
      - positive
      - neutral
      - negative
    sequential_key_binding: true

쌍대 텍스트 비교

yaml
annotation_task_name: Text Comparison
 
data_files:
  - data/pairs.json
 
item_properties:
  id_key: id
  text_key: text
 
list_as_text:
  text_list_prefix_type: alphabet
  horizontal: true
 
annotation_schemes:
  - annotation_type: radio
    name: preference
    description: Which text is better?
    labels:
      - A is better
      - B is better
      - Equal

동작 예시

완전히 동작하는 예시는 project-hub/dialogue_analysis/에서 확인할 수 있습니다.

bash
python potato/flask_server.py start project-hub/dialogue_analysis/configs/dialogue-analysis.yaml -p 8000

샘플 데이터 형식:

json
{"id":"1","text":["Tom: Isn't this awesome?!", "Sam: Yes! I like you!", "Tom: great!", "Sam: Awesome! Let's party!"]}
{"id":"2","text":["Tom: I am so sorry for that", "Sam: No worries", "Tom: thanks for your understanding!"]}

  1. 화자 이름: 대화에서 text_list_prefix_type: none을 사용할 때는 텍스트에 화자 이름을 포함하세요(예: "Tom: Hello").

  2. 스팬 어노테이션: 대화 데이터에 스팬 어노테이션을 사용할 때, 어노테이터는 표시된 어떤 턴 안의 텍스트든 강조할 수 있습니다.

  3. 접두사 선택:

    • 화자 이름이 텍스트에 포함된 대화에는 none을 사용하세요.
    • 순서가 중요할 때는 number를 사용하세요.
    • 쌍대 비교 작업에는 alphabet을 사용하세요.
  4. 가독성: 긴 대화에서는 alternating_shading을 켜서 어노테이터가 지금 읽고 있는 턴을 쉽게 따라가도록 하세요.

  5. 비교 작업: 나란히 비교하려면 alphabet 접두사와 함께 horizontal: true를 사용하세요.

더 읽어보기

구현 세부 사항은 원본 문서를 참조하세요.