You need to enable JavaScript to run this app.
Lake AI Service

Lake AI Service

Copy page
Download PDF
Audio processing
Audio scoring (Audiobox Aesthetics)
Copy page
Download PDF
Audio scoring (Audiobox Aesthetics)

Operator introduction

Description

Audio scoring operator - uses audiobox_aesthetics to score audio quality

Key features

  • Scores audio segments for quality using the audiobox_aesthetics model
  • Provides four scoring dimensions: CE (coherence/listening engagement), CU (clarity/intelligibility), PC (production quality/compositional quality), PQ (perceived quality/subjective audio quality)
  • Supports local and remote (tos://) audio files
  • Applicable to audio quality assessment, audio filtering, quality control, and similar scenarios

Scoring dimension description

  • CE (coherence/listening engagement): Indicates whether the audio content is coherent and whether the audio is engaging from a subjective listening perspective
  • CU (clarity/intelligibility): Indicates the clarity of the sound and the intelligibility of speech
  • PC (production quality/compositional quality): Indicates the quality of recording, mixing, structure, and other production aspects
  • PQ (perceived quality/subjective audio quality): Overall subjective listening quality

Daft invocation

Operator parameters

Input

Input column name

Description

audio_paths

An array containing audio file paths (string type)

Output

Structured result array, where each element contains the following fields:

  • CE (float): Coherence/listening engagement score
  • CU (float): Clarity/intelligibility score
  • PC (float): Production quality/compositional quality score
  • PQ (float): Perceived quality/subjective audio quality score

Audio processing failures return a structure containing a value of 0.0

Parameters

If a parameter does not have a default value, it is required

Parameter name

Type

Default value

Description

model_path

str

/opt/las/models

Model storage root path Default value: "/opt/las/models"

model_name

str

audiobox-aesthetics/checkpoint.pt

Pre-trained model name Default value: "audiobox-aesthetics/checkpoint.pt"

Examples

The following code demonstrates how to use daft to run the operator and score audio.

from __future__ import annotations

import os

import daft
from daft import col
from daft.las.functions.audio import AudioMetascore
from daft.las.functions.udf import las_udf

if __name__ == "__main__":
    TOS_TEST_DIR_URL = os.getenv("TOS_TEST_DIR_URL", "las-cn-beijing-public-online.tos-cn-beijing.volces.com")

    if os.getenv("DAFT_RUNNER", "native") == "ray":
        import logging

        import ray

        def configure_logging():
            logging.basicConfig(
                level=logging.INFO,
                format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
                datefmt="%Y-%m-%d %H:%M:%S",
            )
            logging.getLogger("tracing.span").setLevel(logging.WARNING)
            logging.getLogger("daft_io.stats").setLevel(logging.WARNING)
            logging.getLogger("DaftStatisticsManager").setLevel(logging.WARNING)
            logging.getLogger("DaftFlotillaScheduler").setLevel(logging.WARNING)
            logging.getLogger("DaftFlotillaDispatcher").setLevel(logging.WARNING)

        ray.init(dashboard_host="0.0.0.0", runtime_env={"worker_process_setup_hook": configure_logging})
        daft.set_runner_ray()

    daft.set_execution_config(actor_udf_ready_timeout=600)
    daft.set_execution_config(min_cpu_per_task=0)

    samples = {"audio_path": [f"https://{TOS_TEST_DIR_URL}/public/archive/audio_metascore/sample.wav"]}
    df = daft.from_pydict(samples)
    df = df.with_column(
        "audio_metascore",
        las_udf(
            AudioMetascore,
            num_cpus=1,
            batch_size=1,
            concurrency=1,
        )(col("audio_path")),
    )

    df.show()
    # ╭────────────────────────────────┬────────────────────────────────────────────────────────────╮
    # │ audio_path                     ┆ audio_metascore                                            │
    # │ ---                            ┆ ---                                                        │
    # │ String                         ┆ Struct[CE: Float64, CU: Float64, PC: Float64, PQ: Float64] │
    # ╞════════════════════════════════╪════════════════════════════════════════════════════════════╡
    # │ https://las-public-data-qa.to… ┆ {CE: 5.909880638122559,                                    │
    # │                                ┆ CU: 6…                                                     │
    # ╰────────────────────────────────┴────────────────────────────────────────────────────────────╯
Last updated: 2026.05.12 19:06:34