인스턴스 표시
instance_display 블록을 구성해 Potato 작업에서 텍스트, 이미지, 오디오, 비디오 콘텐츠가 어노테이션 컨트롤 옆에 어떻게 표시될지 제어합니다.
v2.1.0의 새 기능
인스턴스 표시는 어노테이터에게 보여 줄 콘텐츠와 수집할 어노테이션을 분리합니다. 그래서 어떤 콘텐츠 유형 조합(이미지, 비디오, 오디오, 텍스트)이든 어떤 어노테이션 스키마(라디오 버튼, 체크박스, span 등)와도 함께 놓을 수 있습니다.
인스턴스 표시가 필드를 매핑하는 방식
인스턴스 표시를 사용하는 이유는 무엇인가요?
이미지를 보여 주고 라디오 버튼으로 분류하려면, 이미지는 instance_display 아래에, 질문은 annotation_schemes 아래에 선언합니다. image_annotation 스키마는 이미지 위에 그리기 위한 것이지 이미지를 표시하기 위한 것이 아닙니다. min_annotations: 0으로 이 스키마를 추가하던 예전의 우회 방법은 아무도 할 필요가 없는 그리기 작업을 선언하는 셈이었습니다.
지원이 중단된 우회 방법은 다음과 같습니다.
annotation_schemes:
- annotation_type: image_annotation
name: image_display
description: "Unused, present only to display the image"
min_annotations: 0
tools: [bbox]
labels: [unused]
- annotation_type: radio
name: category
description: "What category is this?"
labels: [A, B, C]이미지를 콘텐츠로 선언하면 스키마 목록에는 실제 질문만 남습니다.
instance_display:
fields:
- key: image_url
type: image
annotation_schemes:
- annotation_type: radio
name: category
description: "What category is this?"
labels: [A, B, C]기본 구성
YAML 구성에 instance_display 섹션을 추가합니다.
instance_display:
fields:
- key: "image_url" # Field name in your data JSON
type: "image" # Content type
label: "Image to classify" # Optional header
display_options:
max_width: 600
zoomable: true
layout:
direction: "vertical" # vertical or horizontal
gap: "20px"각 필드에는 데이터 파일의 키와, Potato가 그 키를 렌더링할 때 쓸 표시 유형을 지정합니다. 표시 유형이 인식하지 못하는 옵션 이름은 조용히 무시되지 않고 구성 오류가 되며, 오류 메시지에 가장 가까운 실제 옵션 이름이 나옵니다.
지원되는 표시 유형
Potato에는 표시 유형 31가지가 있습니다. "Span 대상" 열은 아래에서 설명하는 span_target 플래그로 해당 유형이 span 어노테이션을 받을 수 있는지를 나타냅니다.
| 유형 | 설명 | Span 대상 |
|---|---|---|
text | 일반 텍스트 콘텐츠 | 예 |
html | 정제된 HTML 콘텐츠 | 아니요 |
image | 확대 기능이 있는 이미지 표시 | 아니요 |
video | 비디오 플레이어 | 아니요 |
audio | 오디오 플레이어 | 아니요 |
audio_dialogue | 오디오와 동기화된 화자 분리 전사본, 턴별 재생 지원 | 예 |
gallery | 캡션이 달린 스크롤형 이미지 갤러리 | 아니요 |
depth_map | 근거리/원거리 범위 창, 컬러맵, 미터 단위 판독값이 있는 깊이 맵 | 아니요 |
dialogue | 대화 턴 | 예 |
conversation_tree | 접을 수 있는 분기 노드로 된 대화 트리 | 아니요 |
multi_agent_discussion | 에이전트 범례와 필터링이 있는 다중 에이전트 토론 | 예 |
interactive_chat | 상호작용 후 트레이스를 보여 주는 대화형 에이전트 채팅 | 예 |
pairwise | 나란히 비교 | 아니요 |
code | 구문 강조가 적용된 소스 코드 | 예 |
spreadsheet | 행 또는 셀 단위로 어노테이션하는 표 형식 데이터(Excel/CSV) | 아니요 |
document | 리치 문서(Word, Markdown, HTML) | 예 |
pdf | 페이지 컨트롤이 있는 PDF 문서 | 아니요 |
agent_trace | 세로 단계 카드로 보여 주는 에이전트 트레이스 | 아니요 |
coding_trace | diff, 터미널 블록, 파일 트리가 있는 코딩 에이전트 트레이스 | 예 |
eval_trace | 추론, 함수 호출, 최종 답변의 세 창으로 나눈 단일 트레이스 | 예 |
cot_trace | 고정 진행 레일이 있는 긴 사고 사슬(chain-of-thought) 트레이스 | 아니요 |
web_agent_trace | 스크린샷과 클릭 오버레이가 있는 웹 에이전트 트레이스 | 아니요 |
live_agent | 실시간 스크린샷을 보여 주는 라이브 AI 에이전트 뷰어 | 아니요 |
live_coding_agent | 실시간 스트리밍을 보여 주는 라이브 코딩 에이전트 뷰어 | 아니요 |
image_region | 텍스트 줄처럼 큰 이미지의 사각형 한 영역을 브라우저에서 잘라 보여 줌(Digital Humanities) | 아니요 |
protein_structure | 3Dmol.js 또는 Mol*로 보여 주는 단백질 구조(mmCIF, BinaryCIF, PDB), 잔기 선택 지원(단백질 구조) | 아니요 |
genome_locus | 참조, 리드, 변이, 주석 트랙이 있는 igv.js 유전체 좌위(유전체 좌위) | 아니요 |
time_series | uPlot으로 보여 주는 다채널 신호(EDF, WFDB, CSV, Parquet), 확대와 이동 지원, interval_label용 | 아니요 |
spectrum | NMR, IR, 질량 스펙트럼(JCAMP-DX, mzML, CSV), 확대 지원, peak_picking용 | 아니요 |
molecule | SMILES나 molfile로 지정한 소분자, viewer_selection용 원자 선택 지원 | 아니요 |
fits_cutout | 단독 또는 과학·참조·차분 이미지 세 장으로 보여 주는 FITS 이미지 컷아웃, RA/Dec 판독값과 선택적 광도 곡선 포함 | 아니요 |
spreadsheet와 pdf는 span_target 플래그를 받지 않으므로 아니요로 표시했습니다. 두 유형 모두 자기 방식으로 위치를 고정한 어노테이션은 지원합니다. 스프레드시트는 행이나 셀 단위로, PDF는 PDF.js 텍스트 레이어를 통해서입니다.
모든 표시 유형이 받는 옵션
다음 세 옵션은 특정 렌더러가 아니라 Potato가 각 필드를 감싸는 크기 조절 컨테이너에 속하므로, 모든 표시 유형에서 동작합니다.
| 옵션 | 기본값 | 설명 |
|---|---|---|
resizable | true | 어노테이터가 드래그해 크기를 바꿀 수 있는 컨테이너로 필드를 감쌉니다 |
max_height | 500 | 필드 안에서 스크롤이 생기기 전까지 커질 수 있는 높이 |
min_height | 100 | 드래그로 줄일 수 있는 최소 높이 |
길이에는 숫자나 CSS 길이를 쓸 수 있어서 400, "400px", "50vh" 모두 동작하며, 단위 없는 숫자는 픽셀을 뜻합니다. resizable: false는 짧은 필드에 알맞습니다. 한 줄짜리 라벨 주위에 드래그 핸들이 있으면 실수처럼 보이기 때문입니다.
표시 유형 옵션
텍스트 표시
- key: "text"
type: "text"
label: "Document"
display_options:
collapsible: false # Make content collapsible
collapsed_by_default: false # Start collapsed (needs collapsible)
max_height: 400 # Max height in pixels before scrolling
preserve_whitespace: true # Preserve line breaks and spacingcollapsed_by_default를 쓰면 긴 사례 파일이 항목마다 질문을 페이지 아래로 밀어내지 않고, 어노테이터가 펼칠 때까지 접혀 있습니다.
이미지 표시
- key: "image_url"
type: "image"
label: "Image"
display_options:
max_width: 800 # Max width (number or CSS string)
max_height: 600 # Max height
zoomable: true # Enable zoom controls
alt_text: "Description" # Alt text for accessibility
object_fit: "contain" # CSS object-fit property비디오 표시
- key: "video_url"
type: "video"
label: "Video"
display_options:
max_width: 800
max_height: 450
controls: true # Show video controls
autoplay: false # Auto-play on load
loop: false # Loop playback
muted: false # Start muted오디오 표시
- key: "audio_url"
type: "audio"
label: "Audio"
display_options:
controls: true # Show audio controls
autoplay: false
loop: false
show_waveform: false # Show waveform visualization대화 표시
- key: "conversation"
type: "dialogue"
label: "Conversation"
display_options:
alternating_shading: true # Alternate background colors
speaker_extraction: true # Extract "Speaker:" from text
show_turn_numbers: false # Show turn numbers
max_height: 600 # Cap the height and scroll inside it긴 대화는 그대로 두면 어노테이션 양식을 페이지 아래로 밀어냅니다. max_height를 쓰면 내용을 잘라 내지 않고 컨테이너 안에서 스크롤합니다.
대화의 데이터 형식(JSONL 파일의 각 줄):
{"id": "conv_001", "conversation": ["Speaker A: Hello there!", "Speaker B: Hi, how are you?"]}또는 구조화된 데이터로:
{"id": "conv_001", "conversation": [{"speaker": "Alice", "text": "Hello there!"}, {"speaker": "Bob", "text": "Hi, how are you?"}]}쌍대 표시
- key: "comparison"
type: "pairwise"
label: "Compare Options"
display_options:
cell_width: "auto" # "auto" splits the row evenly
show_labels: true # Show A/B labels
labels: ["Option A", "Option B"]
vertical_on_mobile: true # Stack vertically on mobile레이아웃 옵션
여러 필드를 어떻게 배치할지 제어합니다.
instance_display:
layout:
direction: horizontal # horizontal or vertical
gap: 24px # Space between fields가로 방향은 원문과 그 요약처럼 어노테이터가 서로 비교하는 두 필드에 알맞습니다. 세로로 쌓은 필드는 순서대로 읽는 자료에 알맞습니다.
Span 어노테이션 지원
표시 유형 9가지가 span 어노테이션의 대상이 될 수 있습니다. text, dialogue, audio_dialogue, code, document, coding_trace, eval_trace, interactive_chat, multi_agent_discussion입니다. 필드를 span 대상으로 지정하려면 다음과 같이 합니다.
instance_display:
fields:
- key: "document"
type: "text"
span_target: true # Enable span annotation on this field
annotation_schemes:
- annotation_type: span
name: entities
description: "Highlight named entities"
labels: [PERSON, LOCATION, ORG]지원하지 않는 유형에 span_target을 설정하면 구성 오류가 되며, 오류 메시지에 지원하는 유형이 나열됩니다.
여러 Span 대상
span 어노테이션을 지원하는 텍스트 필드를 여러 개 둘 수 있습니다.
instance_display:
fields:
- key: "source_text"
type: "text"
label: "Source Document"
span_target: true
- key: "summary"
type: "text"
label: "Summary"
span_target: true
annotation_schemes:
- annotation_type: span
name: factual_errors
description: "Mark claims in the summary that the source does not support"
labels: [contradiction, unsupported, fabrication]span 대상을 여러 개 쓰면 어노테이션이 필드와 연결되어 저장됩니다.
{
"factual_errors": {
"source_text": [],
"summary": [
{"start": 45, "end": 67, "label": "unsupported"}
]
}
}오프셋은 필드별로 기록되므로, 요약의 span이 원문에서 같은 문자 위치에 있는 span과 섞일 수 없습니다.
수식 렌더링
v2.13.0의 새 기능
최상위 math 블록은 표시 필드, 항목 텍스트, 에이전트 트레이스 단계의 LaTeX를 KaTeX로 렌더링합니다. 그러면 어노테이터는 LaTeX 소스 대신 조판된 수식을 읽습니다. 아래 블록은 수학 튜터링 항목의 두 필드를 렌더링하고 매크로 하나를 정의합니다.
instance_display:
fields:
- key: problem
type: text
label: "Problem"
- key: solution
type: text
label: "Proposed solution"
math:
enabled: true
fields: [problem, solution]
macros:
"\\R": "\\mathbb{R}"이 블록은 네 가지 키를 받습니다.
- **
enabled**는 렌더링을 켜며true또는false만 받습니다. - **
delimiters**는 찾을 구분자를$$,$,\(,\[중에서 나열합니다. 네 가지 모두 기본으로 켜져 있습니다. 데이터에서 달러 기호를 가격에 쓴다면$를 빼십시오. - **
fields**는 렌더링할instance_display필드 키를 지정하며, 이 키를 생략하면 모든 필드를 렌더링합니다.instance_display.fields없이fields를 설정한 설정은 검증에 실패합니다. - **
macros**는 매크로 이름(역슬래시와 그 뒤의 글자들)을 매크로의 전개 결과에 대응시키며, 매크로는 최대 200개입니다.
렌더링은 서버가 항목을 정제한 뒤 어노테이터의 브라우저에서 이루어집니다. KaTeX는 trust: false로 실행되므로 데이터에 있는 \href, \url, \includegraphics는 링크나 이미지를 만들지 않습니다. KaTeX가 파싱하지 못하는 수식은 일부만 렌더링된 출력 대신 수식의 LaTeX 소스를 보여 줍니다.
span_target: true로 표시한 필드는 LaTeX 소스를 계속 보여 줍니다. span 오프셋은 소스 문자 수로 세는데 $x^2$는 다섯 문자이기 때문입니다. instance_display가 없으면 span 같은 텍스트 선택 스키마도 같은 방식으로 항목 텍스트를 소스로 유지합니다. 서버는 소스로 남겨 둔 각 필드를 밝히는 경고를 기록합니다. span 대상 옆에 렌더링된 수식을 보여 주려면 텍스트를 두 번째 항목 필드로 복사하고, 그 필드를 span_target 없이 표시하십시오.
어노테이션 스키마를 표시 필드에 연결하기
미디어 어노테이션 스키마(image_annotation, video_annotation, audio_annotation)는 source_field로 표시 필드에 연결합니다.
instance_display:
fields:
- key: "image_url"
type: "image"
annotation_schemes:
- annotation_type: image_annotation
name: objects
description: "Draw a box around each object"
source_field: "image_url" # Links to display field
tools: [bbox]
labels: [person, car]항목에 이미지가 둘 이상 있거나, 스키마가 스스로 찾을 필드가 아닌 다른 필드 위에 그려야 할 때 필드 이름을 지정합니다. 이미지 필드가 하나뿐이면 image_annotation이 알아서 그 필드를 찾습니다.
턴별 대화 평가
개별 대화 턴에 인라인 평가 위젯을 추가합니다.
instance_display:
fields:
- key: conversation
type: dialogue
label: "Conversation"
display_options:
show_turn_numbers: true
per_turn_ratings:
speakers: ["Agent"] # Only show ratings for these speakers
schema_name: "turn_quality" # Name for the stored annotation data
scheme:
type: likert
size: 5
labels: ["Poor", "Excellent"]speakers를 한쪽으로 제한하면 평가 대상인 턴에만 평가가 붙습니다. 상대편이 고정된 사용자 스크립트일 때 원하는 방식입니다. 평가 원은 해당하는 각 턴 아래에 인라인으로 표시되고, 선택한 값까지 채워지며, 턴 인덱스를 키로 하는 단일 JSON 객체로 저장됩니다.
{
"turn_quality": "{\"0\": 4, \"2\": 5, \"4\": 3}"
}예시: 이미지 분류
annotation_task_name: "Image Classification"
data_files:
- data/images.json
item_properties:
id_key: id
text_key: image_url
task_dir: .
output_annotation_dir: annotation_output
instance_display:
fields:
- key: image_url
type: image
label: "Image to Classify"
display_options:
max_width: 600
zoomable: true
- key: context
type: text
label: "Additional Context"
display_options:
collapsible: true
annotation_schemes:
- annotation_type: radio
name: category
description: "What category best describes this image?"
labels:
- nature
- urban
- people
- objects
user_config:
allow_all_users: true맥락 필드는 보조 자료이므로 접을 수 있게 했습니다. 기본적으로 닫아 두면 이미지와 질문이 한 화면에 들어옵니다.
샘플 데이터 파일(data/images.json)은 JSONL 형식입니다.
{"id": "img_001", "image_url": "https://example.com/image1.jpg", "context": "Taken in summer 2023"}
{"id": "img_002", "image_url": "https://example.com/image2.jpg", "context": "Winter landscape"}예시: 멀티모달 어노테이션
span 어노테이션을 적용한 전사본 옆에 비디오를 표시합니다.
annotation_task_name: "Video Analysis"
data_files:
- data/videos.json
item_properties:
id_key: id
text_key: transcript
task_dir: .
output_annotation_dir: annotation_output
instance_display:
layout:
direction: horizontal
gap: 24px
fields:
- key: video_url
type: video
label: "Video"
display_options:
max_width: "45%"
- key: transcript
type: text
label: "Transcript"
span_target: true
annotation_schemes:
- annotation_type: radio
name: sentiment
description: "What is the overall sentiment of this clip?"
labels: [positive, neutral, negative]
- annotation_type: span
name: highlights
description: "Highlight the passages that support your rating"
labels:
- key_point
- question
- supporting_evidence가로 레이아웃은 비디오를 전사본 옆에 두므로, 어노테이터가 해당 장면에서 스크롤해 벗어나지 않고 구절을 표시할 수 있습니다.
하위 호환성
instance_display가 없는 기존 구성은 변경 없이 계속 작동합니다item_properties의text_key는 여전히 폴백으로 사용됩니다- 어노테이션 스키마를 통한 레거시 미디어 감지도 여전히 작동합니다
- 예전의 표시 전용 패턴을 사용하면 로그에 지원 중단 경고가 표시됩니다
표시 전용 패턴에서 마이그레이션하기
콘텐츠를 표시하기 위한 목적만으로 어노테이션 스키마를 사용하고 있었다면 다음과 같이 바꿉니다.
이전(지원 중단):
annotation_schemes:
- annotation_type: image_annotation
name: image_display
description: "Unused, present only to display the image"
min_annotations: 0
tools: [bbox]
labels: [unused]이후(권장):
instance_display:
fields:
- key: image_url
type: image더 읽어보기
- 데이터 형식 - 지원되는 입력 데이터 형식
- UI 구성 - 인터페이스 사용자 지정
- 레이아웃 사용자 지정 - 사용자 지정 HTML 템플릿
- 이미지 어노테이션 - 이미지 어노테이션 도구
구현 세부 정보는 원본 문서를 참고하세요.