Skip to content

Anotación de Audio

Anota archivos de audio con visualización de forma de onda y controles de reproducción.

Potato 2.0 proporciona una potente anotación de audio con visualización de forma de onda impulsada por Peaks.js, etiquetado de segmentos y atajos de teclado completos.

Casos de Uso

  • Transcripción y revisión de voz
  • Diarización de hablantes
  • Análisis musical
  • Detección de eventos de audio
  • Reconocimiento de emociones en el habla
  • Aseguramiento de calidad en centros de llamadas

Habilitación del Soporte de Audio

Añade una sección audio_annotation a tu configuración:

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

Modos Operacionales

Potato admite tres modos de anotación de audio:

Modo de Etiquetado

Segmenta el audio y asigna etiquetas de categoría a cada segmento:

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

Modo de Preguntas

Añade preguntas de anotación por segmento:

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"

Modo Combinado

Combina el etiquetado con preguntas por segmento:

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"]

Opciones de Configuración

Configuración Básica

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

Atajos de Teclado

Las etiquetas pueden asignarse usando las teclas numéricas 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

Colores de Etiquetas

Personaliza los colores de los segmentos:

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"

Rendimiento de la Forma de Onda

Para un rendimiento óptimo con archivos de audio largos, instala la herramienta audiowaveform de BBC:

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

Esto habilita la generación de formas de onda del lado del servidor. Sin ella, se utiliza la generación del lado del cliente (adecuada para archivos de menos de 30 minutos).

Caché de Formas de Onda

Configura el almacenamiento en caché para un mejor rendimiento:

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

Formato de Datos

Referencia de Audio Simple

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

Con Transcripciones

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

Formato de Salida

Las anotaciones se guardan con marcas de tiempo de segmento:

json
{
  "id": "audio_1",
  "annotations": {
    "segments": [
      {
        "start": 0.0,
        "end": 2.5,
        "label": "Speaker A",
        "questions": {
          "clarity": 4,
          "emotion": "Neutral"
        }
      },
      {
        "start": 2.5,
        "end": 5.2,
        "label": "Speaker B"
      }
    ]
  }
}

Atajos de Teclado

Potato proporciona amplios atajos de teclado para una anotación eficiente:

AtajoAcción
SpaceReproducir/Pausar
[Establecer inicio del segmento en la posición actual
]Establecer fin del segmento en la posición actual
1-9Asignar etiqueta al segmento actual
DeleteEliminar segmento actual
Left ArrowRetroceder 5 segundos
Right ArrowAvanzar 5 segundos
Up ArrowAcercar zoom
Down ArrowAlejar zoom
HomeIr al inicio
EndIr al final
+Aumentar velocidad de reproducción
-Disminuir velocidad de reproducción

Configuraciones de Ejemplo

Diarización de Hablantes

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

Revisión de Transcripción

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

Control de Calidad de Centro de Llamadas

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

Formatos de Audio Soportados

  • WAV (recomendado para mejor calidad)
  • MP3
  • OGG
  • FLAC
  • M4A
  • WebM

Consejos de Rendimiento

  1. Instalar audiowaveform - Esencial para archivos de audio largos
  2. Habilitar caché - Usa cache_dir para almacenar formas de onda pregeneradas
  3. Usar WAV para calidad - Los formatos comprimidos pueden introducir artefactos
  4. Preprocesar audio - Normalizar niveles, recortar silencios innecesarios
  5. Considerar tamaños de archivo - Los archivos grandes ralentizan la carga
  6. Usar precompute - Pregenerar formas de onda para las instancias iniciales

Solución de Problemas

La Forma de Onda No Carga

  • Verificar que la ruta del archivo de audio sea correcta
  • Comprobar que el formato de archivo sea soportado
  • Instalar audiowaveform para archivos largos
  • Revisar la consola del navegador en busca de errores

Rendimiento Lento

  • Instalar la herramienta audiowaveform
  • Habilitar caché de formas de onda
  • Reducir el tamaño de los archivos de audio
  • Usar la configuración precompute_depth

Los Segmentos No Se Guardan

  • Asegurar que el directorio de salida tenga permisos de escritura
  • Verificar la configuración del formato de anotación
  • Comprobar que el segmento tenga tiempos de inicio y fin