This Streamlit app allows research assistants to label when a participant starts and stops speaking in recorded audio clips, or to discard unusable ones.
- Install the Google Cloud CLI.
Note: You will need to request to the
som-nero-phi-jyeatman-webcamcloud project and set up application default credentials. You can do that by running:
gcloud auth application-default login \
--scopes="https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/drive"- If you do not have access to the cloud project, you can also download the data from the Google Drive using a Stanford-affiliated Google account.
- Place the folders in the
audio_datadirectory, which should be in the same directory as thisREADME.mdfile and theaudio_labelling.pyscript. - Your folder structure should look like this:
/Labelling/
βββ README.md
βββ audio_labelling.py
βββ audio_data/
βββ haGCTJT6sYUoVBtuftbldUpKtE82_efschl-hwsch-39691ace/
βββ quaGipSF2vZx7HFKMMQP2Zr3aH62_efschl-hwsch-14e02ac2/
Create a virtual environment (optional but recommended), then install the required Python packages:
pip install -r requirements.txtFrom the same directory, run:
streamlit run audio_labelling.pyYou will first need to make sure you have a train_letters.csv or train_numbers.csv. Once you launch the app, you can drag and drop the csv file into the app. This will automatically download the audio data (if you don't have it already) and then launch the app.
By distributing the audio files across multiple .csv files, you can divide the work across multiple peopleβeach working on a different dataset.
-
You'll be presented with one audio file at a time.
-
Listen to the full clip using the audio player.
-
If the participant spoke clearly:
- Enter the start time and end time in seconds.
- Click β Save and Next to save and move on.
-
Use the checkboxes to indicate whether in the recording:
- There is excessive background noise
- The participant was interrupted
- The clip is inaudible
-
If the clip is inaudible, empty, or unclear, click ποΈ Discard and Next instead.
- Your labels are saved automatically to the same CSV file you uploaded when launching the app.
This file stores the start and end times (or [0, 0] if discarded) for each processed audio clip.
Send these CSV's back when complete!