Command line#
Installing the package adds the ways command. Every command and option below is read from ways/cli.py, and ways --help or ways <command> --help prints the same list. Audio of any sample rate is read with soundfile, mixed to mono and resampled to 16 kHz.
ways explain#
Per-token erasure attribution for one clip.
ways explain clip.wav --backend hf-whisper --model openai/whisper-base --aadd --figure --out out/
ways explain clip.wav --backend hf-moonshine --model UsefulSensors/moonshine-base --out out/
ways explain clip.wav --backend openai-compat --base-url http://localhost:8000/v1 --model openai/whisper-large-v3 --out out/
option |
default |
meaning |
|---|---|---|
|
the clip to explain |
|
|
|
|
|
the backend’s default |
the model id, for example |
|
latest |
the Hugging Face commit of the model, for |
|
|
the server, for |
|
|
|
|
|
patch length in seconds, a multiple of 0.01 |
|
|
number of frequency bands |
|
|
erased patches scored per forward pass |
|
off |
also run AADD and report the noise-focus ratio |
|
|
the AADD checkpoint |
|
off |
also draw the clip figure |
|
|
the output folder |
|
off |
print progress |
It prints the clip summary as JSON, the transcript, and one line per token: its index, the text piece, the centre of its top patch in seconds, the top band, that patch’s share of the evidence and the noise-focus ratio. In the output folder it writes:
file |
contents |
|---|---|
|
the attribution arrays, which |
|
the clip summary and one row per token |
|
the AADD frames, with |
|
the figure, with |
ways latent#
Per-layer Grad-CAM and spill-over when the degraded audio is erased. It needs a white-box backend, and either --aadd or --window, since without a degraded stretch there is nothing to erase.
ways latent clip.wav --backend hf-whisper --model openai/whisper-base --aadd --figure --out out/
ways latent clip.wav --window 1.2 2.0 --out out/
option |
default |
meaning |
|---|---|---|
|
the clip |
|
|
|
|
|
the backend’s default |
the model id |
|
latest |
the Hugging Face commit of the model |
|
off |
erase the stretches AADD flags |
|
|
the AADD checkpoint |
|
erase this stretch instead of AADD’s flags |
|
|
off |
also draw the latent figure |
|
|
the output folder |
It prints one line per encoder layer with the spill-over outside the erased stretch, the shift inside it, the CAM focus and the correlation with loudness. It writes <clip>_latent.npz, <clip>_latent.json, and <clip>_latent.png with --figure.
ways sound-token, ways aud-cam, ways cross-check#
Each registered tool is also a command. The three that ship with WAYS:
command |
question it answers |
backends |
|---|---|---|
|
which audio each word of the transcript used, by erasing the audio patch by patch |
any, one or several |
|
what degraded audio does to the model’s encoder, layer by layer |
white-box |
|
the tokens on degraded audio under both readings, the erasure test and the encoder’s gradient map |
white-box |
ways sound-token clip.wav --backend hf-whisper=openai/whisper-base --backend hf-moonshine=UsefulSensors/moonshine-base --aadd --out out/clip
ways aud-cam clip.wav --backend hf-whisper=openai/whisper-base --aadd --granular --out out/clip
ways cross-check clip.wav --backend hf-whisper=openai/whisper-base --aadd --reference "the human transcript" --out out/clip
option |
meaning |
|---|---|
|
the clip |
|
for example |
|
run AADD v3 to find the degraded audio |
|
a known damaged span instead of AADD’s flags |
|
a human transcript, to report the word error rate ( |
|
also write each lane as its own figure ( |
|
also compute Grad-CAM per token ( |
|
the figure’s title |
|
where the result goes, default |
Each prints its result as JSON. The tool framework explains the tools and how to register a new one, which then appears as a command too.
ways tools#
ways tools # each tool's name, whether it needs a white-box backend, and its summary
ways tools --schema # the function-calling schemas of every tool, as JSON
ways quality#
The AADD degradation timeline for one clip, in frames of 20 ms.
ways quality clip.wav
ways quality clip.wav --aadd-model v3 --out clip_aadd.npy
It prints how many frames were flagged at a probability of 0.5 or more, then each flagged stretch with its class, start, end and peak probability. --out also saves the frame probabilities as a NumPy file.