Audio–Semantic Reasoning Benchmark for Speech-Based Audio Language Models
A comprehensive multi-domain benchmark for evaluating audio–semantic reasoning in speech-based audio language models (ALMs). This benchmark tests semantic grounding, inference robustness, and bias sensitivity across accented speech, institutional discourse, medical communication, and short-form utterances.
Unlike traditional audio captioning, this benchmark focuses on semantic reasoning over spoken content, using transcripts only as annotation scaffolding. At inference time, models are evaluated solely on audio + text hypotheses, ensuring that models learn to infer meaning from speech rather than rely on surface cues.
This benchmark evaluates whether audio language models can:
git clone <repository-url>
cd Afro_entailment
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install torch torchaudio torchvision --extra-index-url https://download.pytorch.org/whl/cu128
uv pip install transformers datasets huggingface-hub pandas tqdm soundfile
# Option 1: Login interactively
python -c "from huggingface_hub import login; login()"
# Option 2: Set environment variable
export HF_TOKEN=your_token_here
Afro_entailment/
├── Audio/ # Audio files (gitignored)
│ ├── data/ # Raw audio files
│ ├── medical/ # Medical domain audio
│ ├── general/ # General domain audio
│ └── Afrispeech_Common_Audio/ # Common audio dataset
├── Entailment/
│ ├── metadata_*.csv # Dataset metadata files
│ ├── models/ # Model runners and utilities
│ │ ├── llms/ # LLM backends (Llama, Mistral)
│ │ ├── runners/ # Task-specific runners
│ │ └── utils/ # I/O utilities
│ └── AudioEntailment/ # Additional audio entailment data
├── result/ # Generated results and annotations
├── download_*.py # Audio download scripts
├── separate_audio_files.py # Audio file organization script
└── README.md
The benchmark uses five speech datasets from distinct domains:
| Dataset | Domain | Description | Size |
|---|---|---|---|
| AfriSpeech–Parliament | Institutional speech | Parliamentary and legislative discourse | ~7,400 samples |
| Medical | Clinical speech | Medical explanations and health-related dialogue | ~20 samples |
| AfriSpeech-200 | Conversational speech | African-accented read and conversational speech | ~6,300 samples |
| General | Open-domain speech | Short everyday utterances | ~29 samples |
| AfriNames | Short-form speech | Minimal utterances with strong accent variation | ~6,300 samples |
All datasets are provided as CSV files in Entailment/ with the following structure:
file_name, transcriptdomain, accent, country, age_group, durationThe benchmark supports five audio–semantic reasoning tasks:
Spoken Natural Language Inference (NLI)
Audio–Text Semantic Consistency
AfriNames serves as a critical fairness evaluation tool with two diagnostic tasks:
Semantic Restraint / Over-Inference Detection
Accent-Conditioned Semantic Drift
The repository includes scripts to download audio files from Hugging Face datasets.
download_audio.py - Download AfriSpeech-Parliament audio filesdownload_afrispeech200_audio.py - Download AfriSpeech-200 audio filesdownload_afri_names_audio.py - Download AfriNames audio filesdownload_and_separate_dialog.py - Download and separate AfriSpeech-Dialog (medical/general)# Download AfriSpeech-Parliament audio files
python download_audio.py YOUR_HF_TOKEN
# Download AfriSpeech-200 audio files
python download_afrispeech200_audio.py YOUR_HF_TOKEN
# Download and separate AfriSpeech-Dialog
python download_and_separate_dialog.py YOUR_HF_TOKEN
# Separate already-downloaded audio files by domain
python separate_audio_files.py
Note: Audio files are automatically excluded from git via .gitignore. They will be downloaded to the Audio/ directory.
Hypotheses are generated using LLM runners. Each dataset has corresponding runners for different tasks.
# Generate NLI hypotheses for Parliament dataset
python -m Entailment.models.runners.run_llama_parliament_entailment \
--csv_path Entailment/metadata_afrispeech-parliament.csv \
--output_dir result/Entailment/Parliament/Llama/entailment_hypotheses \
--model_id meta-llama/Meta-Llama-3.1-8B-Instruct
# Generate consistency hypotheses for Medical dataset
python -m Entailment.models.runners.run_llama_medical_consistency \
--csv_path Entailment/metadata_medical.csv \
--output_dir result/Entailment/Medical/Llama/consistency
Each runner generates a .jsonl file with one JSON object per row:
{
"file_name": "data/example.wav",
"transcript": "Speaker transcript...",
"model_id": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"output": {
"entailment": ["hypothesis 1", "hypothesis 2", "hypothesis 3"],
"neutral": ["hypothesis 1", "hypothesis 2", "hypothesis 3"],
"contradiction": ["hypothesis 1", "hypothesis 2", "hypothesis 3"]
}
}
Multiple hypotheses per label are strongly recommended:
| Task | Recommendation |
|---|---|
| NLI | 2–3 hypotheses per class |
| Consistency | 2 variants per label |
| Intent | 1–2 per intent |
| Plausibility | 2 per label |
| AfriNames diagnostics | Multiple neutral controls |
Why multiple hypotheses?
Across all tasks:
This ensures fair comparison across datasets and models.
The benchmark evaluates:
For each audio clip:
Each dataset CSV includes:
file_name - Path to audio filetranscript - Ground truth transcript (for annotation only)If you use this benchmark in your research, please cite:
@article{afro_entailment,
title={Afro_entailment: Audio–Semantic Reasoning Benchmark for Speech-Based Audio Language Models},
author={Your Name},
journal={Your Journal},
year={2024}
}
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
For questions or issues, please open an issue on the repository.
Note: Audio files and large datasets are excluded from git via .gitignore. Download them using the provided scripts before running inference.
13 commits
Python
77.9%
Shell
19.8%
TeX
2.4%
Audio–Semantic Reasoning Benchmark for Speech-Based Audio Language Models
A comprehensive multi-domain benchmark for evaluating audio–semantic reasoning in speech-based audio language models (ALMs). This benchmark tests semantic grounding, inference robustness, and bias sensitivity across accented speech, institutional discourse, medical communication, and short-form utterances.
Unlike traditional audio captioning, this benchmark focuses on semantic reasoning over spoken content, using transcripts only as annotation scaffolding. At inference time, models are evaluated solely on audio + text hypotheses, ensuring that models learn to infer meaning from speech rather than rely on surface cues.
This benchmark evaluates whether audio language models can:
git clone <repository-url>
cd Afro_entailment
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install torch torchaudio torchvision --extra-index-url https://download.pytorch.org/whl/cu128
uv pip install transformers datasets huggingface-hub pandas tqdm soundfile
# Option 1: Login interactively
python -c "from huggingface_hub import login; login()"
# Option 2: Set environment variable
export HF_TOKEN=your_token_here
Afro_entailment/
├── Audio/ # Audio files (gitignored)
│ ├── data/ # Raw audio files
│ ├── medical/ # Medical domain audio
│ ├── general/ # General domain audio
│ └── Afrispeech_Common_Audio/ # Common audio dataset
├── Entailment/
│ ├── metadata_*.csv # Dataset metadata files
│ ├── models/ # Model runners and utilities
│ │ ├── llms/ # LLM backends (Llama, Mistral)
│ │ ├── runners/ # Task-specific runners
│ │ └── utils/ # I/O utilities
│ └── AudioEntailment/ # Additional audio entailment data
├── result/ # Generated results and annotations
├── download_*.py # Audio download scripts
├── separate_audio_files.py # Audio file organization script
└── README.md
The benchmark uses five speech datasets from distinct domains:
| Dataset | Domain | Description | Size |
|---|---|---|---|
| AfriSpeech–Parliament | Institutional speech | Parliamentary and legislative discourse | ~7,400 samples |
| Medical | Clinical speech | Medical explanations and health-related dialogue | ~20 samples |
| AfriSpeech-200 | Conversational speech | African-accented read and conversational speech | ~6,300 samples |
| General | Open-domain speech | Short everyday utterances | ~29 samples |
| AfriNames | Short-form speech | Minimal utterances with strong accent variation | ~6,300 samples |
All datasets are provided as CSV files in Entailment/ with the following structure:
file_name, transcriptdomain, accent, country, age_group, durationThe benchmark supports five audio–semantic reasoning tasks:
Spoken Natural Language Inference (NLI)
Audio–Text Semantic Consistency
AfriNames serves as a critical fairness evaluation tool with two diagnostic tasks:
Semantic Restraint / Over-Inference Detection
Accent-Conditioned Semantic Drift
The repository includes scripts to download audio files from Hugging Face datasets.
download_audio.py - Download AfriSpeech-Parliament audio filesdownload_afrispeech200_audio.py - Download AfriSpeech-200 audio filesdownload_afri_names_audio.py - Download AfriNames audio filesdownload_and_separate_dialog.py - Download and separate AfriSpeech-Dialog (medical/general)# Download AfriSpeech-Parliament audio files
python download_audio.py YOUR_HF_TOKEN
# Download AfriSpeech-200 audio files
python download_afrispeech200_audio.py YOUR_HF_TOKEN
# Download and separate AfriSpeech-Dialog
python download_and_separate_dialog.py YOUR_HF_TOKEN
# Separate already-downloaded audio files by domain
python separate_audio_files.py
Note: Audio files are automatically excluded from git via .gitignore. They will be downloaded to the Audio/ directory.
Hypotheses are generated using LLM runners. Each dataset has corresponding runners for different tasks.
# Generate NLI hypotheses for Parliament dataset
python -m Entailment.models.runners.run_llama_parliament_entailment \
--csv_path Entailment/metadata_afrispeech-parliament.csv \
--output_dir result/Entailment/Parliament/Llama/entailment_hypotheses \
--model_id meta-llama/Meta-Llama-3.1-8B-Instruct
# Generate consistency hypotheses for Medical dataset
python -m Entailment.models.runners.run_llama_medical_consistency \
--csv_path Entailment/metadata_medical.csv \
--output_dir result/Entailment/Medical/Llama/consistency
Each runner generates a .jsonl file with one JSON object per row:
{
"file_name": "data/example.wav",
"transcript": "Speaker transcript...",
"model_id": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"output": {
"entailment": ["hypothesis 1", "hypothesis 2", "hypothesis 3"],
"neutral": ["hypothesis 1", "hypothesis 2", "hypothesis 3"],
"contradiction": ["hypothesis 1", "hypothesis 2", "hypothesis 3"]
}
}
Multiple hypotheses per label are strongly recommended:
| Task | Recommendation |
|---|---|
| NLI | 2–3 hypotheses per class |
| Consistency | 2 variants per label |
| Intent | 1–2 per intent |
| Plausibility | 2 per label |
| AfriNames diagnostics | Multiple neutral controls |
Why multiple hypotheses?
Across all tasks:
This ensures fair comparison across datasets and models.
The benchmark evaluates:
For each audio clip:
Each dataset CSV includes:
file_name - Path to audio filetranscript - Ground truth transcript (for annotation only)If you use this benchmark in your research, please cite:
@article{afro_entailment,
title={Afro_entailment: Audio–Semantic Reasoning Benchmark for Speech-Based Audio Language Models},
author={Your Name},
journal={Your Journal},
year={2024}
}
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
For questions or issues, please open an issue on the repository.
Note: Audio files and large datasets are excluded from git via .gitignore. Download them using the provided scripts before running inference.
13 commits
Python
77.9%
Shell
19.8%
TeX
2.4%