This repository contains the research code for a University of Bonn research collaboration on dialect identification using LLM reasoning. The results are reported in the paper "Can LLM Agents Identify Spoken Dialects like a Linguist?", henceforth referred to as "the paper". The repository only contains the files for which we have distribution rights, see Data section.
The final results reported in the paper correspond to the langgraph approach.
- To run the test inference, execute langgraph_agent_optimized.py.
- All prompt versions used in the experiments are available in testing/prompts.py.
The HuBERT/helpers.py module provides utility functions for audio preprocessing.
It prepares the input data for HuBERT training and label classification.
The HuBERT/training_pipeline.py module implements the complete training workflow, including:
- validation set evaluation,
- model checkpointing,
- and label inference without requiring additional training.
Before running the pipeline, configure the parameters in HuBERT/hubert_training_config.py.
To start training or inference, execute HuBERT/training_pipeline.py.
- Due to licensing restrictions, users of this repository are encouraged to request dataset access through the official SwissNLP portal: https://swissnlp.org/home/activities/datasets/.
- We provide our dataset splits for the Swiss Dial and 2Wiesinger-based "2-class problem" labels. However, these splits still require access to the official datasets.
- The SwissDial test dataset splits contain the automatic phonetic transcription output of the phonetic ASR model we used.
- For reproducibility we provide our file structure or hierarchy below:
data1.1 |---ag |---ch_ag_0000.wav ... |---be ... |---bs ... |---gr ... |---lu ... |---sg ... |---vs ... |---zh ... sampled_datasets |---sample_test.tsv langGraph |---reasoning_data |---results |---testing |---prompts.py |---tools.py |---dialect_analysis_nodes.py |---langgraph_agent_optimized.py