본문으로 건너뛰기

오디오 주석

Potato에서 파형 기반 오디오 주석을 구성합니다. 인터랙티브 재생 컨트롤을 표시하고, 시간 마커를 설정하며, radio, likert, 텍스트 스키마와 결합합니다.

Potato 2.0은 Peaks.js로 구동되는 파형 시각화, 세그먼트 레이블링, 키보드 단축키를 갖춘 오디오 주석을 지원합니다.

재생 및 레이블 컨트롤 위에 레이블이 붙은 세 구간(음성, 음악, 음성)이 있는 오디오 파형파형에 그린 구간을 도구 모음에서 레이블링합니다

사용 사례

  • 음성 전사 및 검토
  • 화자 분할
  • 음악 분석
  • 오디오 이벤트 감지
  • 음성의 감정 인식
  • 콜센터 품질 보증

오디오 지원 활성화

오디오 작업은 annotation_schemes의 audio_annotation 스키마입니다. 스키마는 item_properties.text_key가 지정한 필드에서 오디오 URL을 읽으므로 별도의 미디어 키가 필요 없습니다.

yaml
annotation_schemes:
  - annotation_type: audio_annotation
    name: audio_segments
    description: "Segment and label the audio"
    labels:
      - Speech
      - Music
      - Silence
      - Noise

작동 모드

Potato는 세 가지 오디오 주석 모드를 지원합니다.

레이블 모드

오디오를 분할하고 각 세그먼트에 카테고리 레이블을 할당합니다.

yaml
annotation_schemes:
  - annotation_type: audio_annotation
    name: speaker_diarization
    mode: label
    description: "Identify speakers in the audio"
    labels:
      - Speaker A
      - Speaker B
      - Overlap

질문 모드

각 세그먼트는 단일 레이블 대신 자체 질문 세트를 받습니다. 어노테이터는 영역을 표시하고, 선택하고, Segment Details 패널에서 질문에 답합니다. 이 모드에서는 segment_schemes가 필수이며, 각 항목은 세그먼트마다 렌더링되는 일반 주석 스키마입니다.

yaml
annotation_schemes:
  - annotation_type: audio_annotation
    name: speech_quality
    mode: questions
    description: "Evaluate speech segments"
    segment_schemes:
      - annotation_type: radio
        name: speaker_type
        description: "Who is speaking?"
        labels: ["host", "guest", "unknown"]
      - annotation_type: likert
        name: clarity
        description: "How clear is this segment?"
        size: 5
        min_label: "Unintelligible"
        max_label: "Perfectly clear"

결합 모드

레이블링과 세그먼트별 질문을 결합합니다. 이 모드는 labels와 segment_schemes를 함께 요구합니다.

yaml
annotation_schemes:
  - annotation_type: audio_annotation
    name: full_analysis
    mode: both
    description: "Label and analyze audio segments"
    labels:
      - Speech
      - Music
      - Noise
    segment_schemes:
      - annotation_type: radio
        name: foreground
        description: "Is this the foreground audio?"
        labels: ["Yes", "No"]

응답은 항목이 아니라 세그먼트에 놓이며 하위 스키마의 name을 키로 합니다. 세그먼트 질문을 중심으로 설계하기 전에 알아 둘 한계가 두 가지 있습니다. 세그먼트의 필드는 선택된 동안에만 존재하므로 세그먼트 안에서는 키 바인딩이 동작하지 않고, 하위 스키마에는 label_requirement가 적용되지 않습니다. 세그먼트를 필수로 하려면 min_segments를 사용하고, 완전성은 분석 중에 확인하십시오.

구성 옵션

기본 설정

yaml
annotation_schemes:
  - annotation_type: audio_annotation
    name: segments
    description: "Create audio segments"
    labels:
      - Label A
      - Label B
 
    # Optional constraints
    min_segments: 1
    max_segments: 50

키보드 단축키

숫자 키 1-9를 사용하여 레이블을 할당할 수 있습니다.

yaml
annotation_schemes:
  - annotation_type: audio_annotation
    name: speakers
    description: "Mark each speaker turn"
    labels:
      - Speaker A  # Press 1
      - Speaker B  # Press 2
      - Overlap    # Press 3

레이블 색상

세그먼트 색상을 사용자 정의합니다.

yaml
annotation_schemes:
  - annotation_type: audio_annotation
    name: segments
    description: "Segment the recording and label each region"
    labels:
      - name: Speech
        color: "#22C55E"
      - name: Music
        color: "#3B82F6"
      - name: Silence
        color: "#9CA3AF"

파형 성능

긴 오디오 파일에서 최적의 성능을 얻으려면 BBC audiowaveform 도구를 설치하십시오.

bash
# macOS
brew install audiowaveform
 
# Ubuntu/Debian
sudo apt-get install audiowaveform
 
# Or build from source
# https://github.com/bbc/audiowaveform

audiowaveform이 설치되어 있으면 Potato는 서버에서 파형을 미리 계산합니다. 없으면 브라우저가 생성하며, 30분 미만의 파일에서는 이것으로 충분합니다.

파형 캐싱

서버 측 파형은 캐시할 가치가 있습니다. 한 시간 길이의 녹음 하나를 계산하는 데 몇 초가 걸리고, 어노테이터는 페이지를 로드할 때마다 그 비용을 치르기 때문입니다. 최상위 audio_annotation 블록이 캐시를 제어합니다.

yaml
audio_annotation:
  waveform_cache_dir: waveform_cache/     # Where pre-computed waveforms are stored
  waveform_look_ahead: 3                  # Pre-compute the next N instances
  waveform_cache_max_size: 50             # Maximum cached waveform files
  client_fallback_max_duration: 1800      # Longest file the browser will render, in seconds

Potato는 작업에 실제로 audio_annotation 스키마가 있을 때만 이 블록을 읽습니다.

데이터 형식

간단한 오디오 참조

json
[
  {"id": "1", "audio_path": "audio/recording_001.wav"},
  {"id": "2", "audio_path": "audio/recording_002.wav"}
]
yaml
data_files:
  - "data/audio_data.json"
 
item_properties:
  id_key: id
  text_key: audio_path   # The field holding the audio URL

전사본 포함

json
[
  {
    "id": "1",
    "audio_path": "audio/call_001.wav",
    "transcript": "Hello, how can I help you today?"
  }
]

이처럼 평평한 문자열은 파형 옆에 전사본을 맥락으로 보여 줍니다. 전사본에 타이밍이 있다면(Whisper, 클라우드 ASR API, 자막 파일에서 온 것) 대신 파일 자체를 전달하십시오. 그러면 Potato가 그 턴을 오디오와 동기화된 화자 말풍선으로 렌더링합니다.

json
[
  {
    "id": "1",
    "conversation": {"audio": "audio/call_001.wav",
                     "transcript": "audio/call_001.srt"}
  }
]

21가지 전사본 및 자막 형식이 확장자가 아니라 내용으로 인식됩니다. 전사본 형식을 참조하십시오.

출력 형식

타임라인 응답은 하나의 값으로 통째로 직렬화되므로, labels 아래 스키마의 항목은 값이 JSON 문자열인 _data 키 하나를 가집니다. 세그먼트 시간은 start_time과 end_time이며, segment_schemes의 세그먼트별 응답은 annotations 아래에 놓입니다.

json
{
  "instance_id": "audio_1",
  "user_id": "annotator1",
  "labels": {
    "speaker_turns": {
      "_data": "{\"segments\": [{\"id\": \"seg_1\", \"start_time\": 0.0, \"end_time\": 2.5, \"label\": \"Speaker A\", \"annotations\": {\"clarity\": \"4\"}}, {\"id\": \"seg_2\", \"start_time\": 2.5, \"end_time\": 5.2, \"label\": \"Speaker B\", \"annotations\": {}}]}"
    }
  },
  "spans": {},
  "links": {}
}

파싱하면 그 _data 문자열은 다음과 같습니다.

json
{
  "segments": [
    {
      "id": "seg_1",
      "start_time": 0.0,
      "end_time": 2.5,
      "label": "Speaker A",
      "annotations": {"clarity": "4"}
    },
    {
      "id": "seg_2",
      "start_time": 2.5,
      "end_time": 5.2,
      "label": "Speaker B",
      "annotations": {}
    }
  ]
}

비디오 어노테이션도 같은 방식으로 직렬화됩니다. 키가 하나뿐인 이 형태 때문에, 두 주석자를 비교하는 하위 시스템은 server_utils/annotation_values.py의 리더를 거치지 않으면 _data와 _data를 비교하게 됩니다.

키보드 단축키

Potato는 효율적인 주석을 위한 다양한 키보드 단축키를 제공합니다.

단축키동작
Space재생/일시정지
[현재 위치에서 세그먼트 시작 설정
]현재 위치에서 세그먼트 끝 설정
1-9현재 세그먼트에 레이블 할당
Delete현재 세그먼트 제거
Left Arrow5초 뒤로 이동
Right Arrow5초 앞으로 이동
Up Arrow확대
Down Arrow축소
Home시작으로 이동
End끝으로 이동
+재생 속도 높이기
-재생 속도 낮추기

구성 예시

화자 분할

yaml
annotation_task_name: "Speaker Diarization"
task_dir: "."
port: 8000
 
data_files:
  - "data/recordings.json"
 
item_properties:
  id_key: id
  text_key: audio_path
 
annotation_schemes:
  - annotation_type: audio_annotation
    name: speakers
    mode: label
    description: "Identify who is speaking"
    labels:
      - Speaker 1
      - Speaker 2
      - Speaker 3
      - Overlap
      - Silence
    min_segments: 1
 
# Diarization recordings run long, so precompute a few ahead of the annotator.
audio_annotation:
  waveform_cache_dir: waveform_cache/
  waveform_look_ahead: 5
 
output_annotation_dir: "output/"
export_annotation_format: jsonl
 
user_config:
  allow_all_users: true

전사 검토

yaml
annotation_task_name: "Transcription Quality Review"
task_dir: "."
port: 8000
 
data_files:
  - "data/transcripts.json"
 
item_properties:
  id_key: id
  text_key: audio_path
 
annotation_schemes:
  - annotation_type: audio_annotation
    name: errors
    mode: questions
    description: "Mark transcription errors"
    # Questions mode collects answers per marked region, so the error type and
    # the correction stay attached to the stretch of audio they describe.
    segment_schemes:
      - annotation_type: radio
        name: error_type
        description: "What kind of error is this?"
        labels: ["Substitution", "Deletion", "Insertion", "Speaker mix-up"]
      - annotation_type: text
        name: correction
        description: "What should the transcript say?"
 
  - annotation_type: radio
    name: overall_accuracy
    description: "Overall transcript accuracy"
    labels:
      - Accurate
      - Minor errors
      - Major errors
      - Unusable
 
output_annotation_dir: "output/"
export_annotation_format: jsonl

위의 구성은 전사본을 파형과 대조하며 세그먼트 단위로 검토합니다. 전사본이 ASR 파이프라인에서 나와 이미 타이밍을 갖고 있다면 speech_transcript 스키마가 더 잘 맞습니다. 이 스키마는 Whisper, Deepgram, AssemblyAI, SRT, WebVTT 및 기타 시간 정보가 있는 형식을 직접 읽고, 어노테이터에게 오류 태그와 수정 상자가 있는 세그먼트 카드를 제공합니다. 전사본 형식과 Whisper 전사본 어노테이션을 참조하십시오.

콜센터 QA

yaml
annotation_task_name: "Call Center Quality Assurance"
task_dir: "."
port: 8000
 
data_files:
  - "data/calls.json"
 
item_properties:
  id_key: call_id
  text_key: recording_path
 
annotation_schemes:
  # Segment-level annotation
  - annotation_type: audio_annotation
    name: conversation
    mode: both
    description: "Segment the conversation"
    labels:
      - Agent
      - Customer
      - Hold
      - Silence
    # Who is speaking is a label; how the turn went is a question about it.
    segment_schemes:
      - annotation_type: radio
        name: tone
        description: "Tone of this turn"
        labels: ["Calm", "Neutral", "Escalated"]
 
  # Call-level assessment
  - annotation_type: likert
    name: professionalism
    description: "Agent professionalism"
    size: 5
    min_label: "Poor"
    max_label: "Excellent"
 
  - annotation_type: likert
    name: resolution
    description: "Issue resolution"
    size: 5
    min_label: "Unresolved"
    max_label: "Fully resolved"
 
  - annotation_type: multiselect
    name: issues
    description: "Select any issues observed"
    labels:
      - Long hold time
      - Agent interrupted
      - Incorrect information
      - Missing greeting
      - Unprofessional language
 
  - annotation_type: text
    name: notes
    description: "Additional observations"
    rows: 4
 
output_annotation_dir: "output/"
export_annotation_format: jsonl

지원되는 오디오 형식

  • WAV (최상의 품질을 위해 권장)
  • MP3
  • OGG
  • FLAC
  • M4A
  • WebM

성능 팁

  1. audiowaveform 설치 - 서버 측 파형이 한 시간 길이의 파일을 쓸 만하게 유지합니다
  2. 캐싱 활성화 - waveform_cache_dir을 설정하여 미리 생성된 파형을 저장합니다
  3. 품질을 위해 WAV 사용 - 압축 형식은 아티팩트를 유발할 수 있습니다
  4. 오디오 전처리 - 레벨을 정규화하고 불필요한 무음을 잘라냅니다
  5. 파일 크기 고려 - 큰 파일은 로딩 속도를 늦춥니다
  6. 미리 내다보기 - waveform_look_ahead를 올려 어노테이터가 도달하기 전에 다음 인스턴스가 준비되게 합니다

문제 해결

파형이 로드되지 않음

  • 오디오 파일 경로가 올바른지 확인합니다
  • 파일 형식이 지원되는지 확인합니다
  • 긴 파일의 경우 audiowaveform을 설치합니다
  • 브라우저 콘솔에서 오류를 확인합니다

느린 성능

  • audiowaveform 도구를 설치합니다
  • waveform_cache_dir로 파형 캐싱을 활성화합니다
  • 오디오 파일 크기를 줄입니다
  • waveform_look_ahead를 올려 이후 인스턴스를 미리 계산합니다

세그먼트가 저장되지 않음

  • 출력 디렉터리에 쓰기 권한이 있는지 확인합니다
  • 주석 형식 구성을 확인합니다
  • 세그먼트에 시작 및 끝 시간이 모두 있는지 확인합니다