Library to parse speech datasets stored in a generic format based on TextGrids. A tool (CLI) for converting common datasets like LJ Speech into a generic format is included.
Project description
speech-dataset-parser
Library to parse speech datasets stored in a generic format based on TextGrids. A tool (CLI) for converting common datasets like LJ Speech into a generic format is included.
Speech datasets consists of pairs of .TextGrid and .wav files. The TextGrids need to contain a tier which has each symbol separated in an interval, e.g., T|h|i|s| |i|s| |a| |t|e|x|t|.
Generic Format
The format is as follows: {Dataset name}/{Speaker name};{Speaker gender};{Speaker language}[;{Speaker accent}]/[Subfolder(s)]/{Recordings as .wav- and .TextGrid-pairs}
Example: LJ Speech/Linda Johnson;2;eng;North American/wavs/...
Speaker names can be any string (excluding ;
symbols).
Genders are defined via their ISO/IEC 5218 Code.
Languages are defined via their ISO 639-2 Code (bibliographic).
Accents are optional and can be any string (excluding ;
symbols).
Installation
pip install speech-dataset-parser --user
Library Usage
from speech_dataset_parser import parse_dataset
entries = list(parse_dataset(folder..., grid-tier-name...))
The resulting entries
list contains dataclass instances with these properties:
symbols: Tuple[str, ...]
intervals: Tuple[float, ...]
symbols_language: str
speaker_name: str
speaker_accent: str
speaker_gender: int
audio_file_abs: Path
min_time: float
max_time: float
CLI Usage
dataset-converter-cli [-h] [-v] {convert-ljs,convert-l2arctic,convert-thchs} ...
CLI Features
convert-ljs
: convert LJ Speech dataset to a generic datasetconvert-l2arctic
: convert L2-ARCTIC dataset to a generic datasetconvert-thchs
: convert THCHS-30 dataset to a generic dataset
CLI Example
# Convert LJ Speech dataset with symbolic links to the audio files
dataset-converter-cli convert-ljs \
"/data/datasets/LJSpeech-1.1" \
"/tmp/ljs" \
--tier "Symbols" \
--symlink
Dependencies
tqdm
TextGrid>=1.5
ordered_set>=4.1.0
Roadmap
- Supporting conversion of more datasets
- Adding more tests
License
MIT License
Acknowledgments
Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project-ID 416228727 – CRC 1410
Citation
If you want to cite this repo, you can use this BibTeX-entry generated by GitHub (see About => Cite this repository).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for speech-dataset-parser-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ffd264d5e386267c9db2a08e193e612cbd2ec9cac0ba8d8e0109e0473c0d803 |
|
MD5 | fd36155e92c98db9effd561cccf56e8e |
|
BLAKE2b-256 | 0e471c8fa898bc42842aae8992323169a1d4de988bcbd367471ebd2d51931308 |
Hashes for speech_dataset_parser-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e805d0408255e548eddda268ef53b7c728d9d5af2b2b06c8dbeeb67aed5ed744 |
|
MD5 | c50c6cfebf0d7ab905f513be418d2386 |
|
BLAKE2b-256 | 0c05939e9a95afe4c21add34082c15c0bce84c261c7741242e6fca0ea93b6af7 |