Code Monkey home page Code Monkey logo

outliers's Introduction

Outliers

An Outlier Analysis of Vowel Formants from a Corpus Phonetics Pipeline

Emily P. Ahn (University of Washington)

Tools/Versions

  • Python 3.9.0
  • Montreal Forced Aligner 2.0.0 (via conda)
  • R 4.2.2
  • Praat 6.0.16

Documentation

  • Paper PDF: ./Outliers_Interspeech_230601.pdf
  • Poster PDF: ./poster_interspeech_emilyahn_2023.pdf

Citation

@inproceedings{ahn_outlier_2023,
  title={An Outlier Analysis of Vowel Formants from a Corpus Phonetics Pipeline},
  author={Ahn, Emily P and Levow, Gina-Anne and Wright, Richard A and Chodroff, Eleanor},
  year = {2023},
  booktitle = {Interspeech},
}

Notes for this Repository

  • Disclaimer: scripts that are 'quick-and-dirty' start with q_ and are not meant to reflect high quality code

Preprocessing Data

CommonVoice v8

  • download data, follow data/cv8/{lang}/processCommonVoice_{lang}_v8.txt steps
    • (includes using praat scripts, Epitran for G2P, MFA for forced alignment)
  • extract formants with src/getFormantsCommonVoice_highlow.praat (under high and low settings)
  • assign each speaker to either high or low formant setting (will use only low for analysis) with python src/assign_formant_range.py > data/cv8/formants/settings_highlow.tsv
    • filter this file to just get low setting speakers: head -1 data/cv8/formants/settings_highlow.tsv > data/cv8/formants/settings_low.tsv; cat data/cv8/formants/settings_highlow.tsv | awk '$3 == "low" {print}' >> data/cv8/formants/settings_low.tsv
  • quick script to just get formant data of F1/F2 midpoints and low setting speakers only: src/q_simplify_cv_formants.py
  • additional script to get AVG F1/F2 per vowel per speaker: src/get_avg_form_cvlow.py

Wilderness

Discovering Errors

  • From formant files, create distributions per vowel with src/mahal_{wild,cv}.py
    • uses SciKit Learn package MinCovDet
    • output to another csv file with column 'MD' (Mahalanobis distance)
    • src/mahal_cv.py can take a subset argument to only get n utterances (used in this case for Common Voice Swedish)
  • To get outliers at 0.1% edge of distribution, use mahal_thresh = 13.82 (alpha = 0.001, 2 degrees of freedom)
  • Subset errors (thresh = 13.82, num_samples = 100) with python src/q_random_errors.py data/wild/mahal/{lang}_vowels_all.csv data/wild/annotate/{lang}_vowels_100.csv
    • Subset at other points along the MD distribution (e.g. 'near-perfect' samples of Mahal dist < 1.0) python src/q_random_good.py data/cv8/mahal/kazakh_vowels_all.csv data/cv8/annotate/kazakh_good_40.csv 1 40
  • Move only num_samples audio and textgrids into folders for annotation:
# wild errors
lang="SWESFV"; for utt_id in `cat data/wild/annotate/${lang}_errors_100.csv | tail -n +2 | cut -d"," -f1 | sort -u`; do source_file="/Users/eahn/work/typ/data/audio/wav_seg/${lang}/${utt_id}.wav"; cp $source_file data/wild/audio/${lang}_errors_100; done
lang="SWESFV"; for utt_id in `cat data/wild/annotate/${lang}_errors_100.csv | tail -n +2 | cut -d"," -f1 | sort -u`; do source_file="data/wild/tg_ipa/${lang}/${utt_id}.TextGrid"; cp $source_file data/wild/annotate/tg/${lang}_errors_100; done
# wild good
lang="SWESFV"; wav_dir="data/wild/audio/${lang}_good_40_wav"; mkdir $wav_dir; for utt_id in `cat data/wild/annotate/${lang}_good_40.csv | tail -n +2 | cut -d"," -f1 | sort -u`; do source_file="/Users/eahn/work/typ/data/audio/wav_seg/${lang}/${utt_id}.wav";  cp $source_file $wav_dir; done
lang="SWESFV"; tg_dir="data/wild/annotate/tg/${lang}_good_40_tg"; mkdir $tg_dir; for utt_id in `cat data/wild/annotate/${lang}_good_40.csv | tail -n +2 | cut -d"," -f1 | sort -u`; do source_file="data/wild/tg_ipa/${lang}/${utt_id}.TextGrid";  cp $source_file $tg_dir; done
# cv errors
lang="kazakh"; wav_dir="data/cv8/annotate/${lang}_errors_100_wav"; mkdir $wav_dir;for utt_id in `cat data/cv8/annotate/${lang}_errors_100.csv | tail -n +2 | cut -d"," -f1 | sort -u`; do source_file="data/cv8/${lang}/prep_validated/${utt_id}.wav";  cp $source_file $wav_dir; done
lang="hausa"; tg_dir="data/cv8/annotate/${lang}_errors_100_tg"; mkdir $tg_dir;for utt_id in `cat data/cv8/annotate/${lang}_errors_100.csv | tail -n +2 | cut -d"," -f1 | sort -u`; do source_file="data/cv8/${lang}/aligned_validated/${utt_id}.TextGrid";  cp $source_file $tg_dir; done
# cv good files
lang="kazakh"; wav_dir="data/cv8/annotate/${lang}_good_40_wav"; mkdir $wav_dir;for utt_id in `cat data/cv8/annotate/${lang}_good_40.csv | tail -n +2 | cut -d"," -f1 | sort -u`; do source_file="data/cv8/${lang}/prep_validated/${utt_id}.wav";  cp $source_file $wav_dir; done
lang="hausa"; tg_dir="data/cv8/annotate/${lang}_good_40_tg"; mkdir $tg_dir;for utt_id in `cat data/cv8/annotate/${lang}_good_40.csv | tail -n +2 | cut -d"," -f1 | sort -u`; do source_file="data/cv8/${lang}/aligned_validated/${utt_id}.TextGrid";  cp $source_file $tg_dir; done

Annotations

  • Guidelines: see ./AnnotationGuidelines.pdf
  • Master spreadsheet including re-annotations with new Formant category: data/master_reannot_221114.csv

Analysis

  • logistic regression for Kazakh high vowel deletion case study:
    • prep data: src/prep_logregsib_data.py
    • run regression in R: src/logreg_deletion.R

Acknowldgments

We thank Anna Batra, Sam Briggs, Ivy Guo, and Emma Miller for their work on the annotations, processing of results, and exploratory data analyses. Author EPA was supported by NSF GRFP grant DGE-2140004, and Author EC by SNSF grant 208460.

outliers's People

Contributors

emilyahn avatar

Stargazers

Sothy Chanty avatar Eleanor Chodroff avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.