facebookresearch / fairseq

Facebook AI Research Sequence-to-Sequence Toolkit written in Python.
MIT License
30.36k stars 6.4k forks source link

how to generate .tsv and .ltr file when use hubert ??? #4130

Open Wuyazixu opened 2 years ago

Wuyazixu commented 2 years ago

the guide of exmples/hubert is below:

Decode a HuBERT model Suppose the test.tsv and test.ltr are the waveform list and transcripts of the split to be decoded, saved at /path/to/data

but there is no guide how to gegnerate .tsv and .ltr file.Dose some one know?

avneet-singh-nextiva commented 2 years ago

Do we have any example files for these two? /fairseq/examples/speech_to_text/prep_librispeech_data.py creates .tsv file with audio file in each line. Is this the right format?

wnhsu commented 2 years ago

Hi, you could use this script to generate label files

suppose you have one audio file at /path/to/root/name.wav with transcript "how are you"

test.tsv is like

/path/to/root/
name.wav\t<num_of_sample>
is the number of samples in the audio file, which you can get with `soxi -s` test.ltr is like ``` H O W | A R E | Y O U | ```