Package: s3prl
ContactWe prefer to have discussions directly on Github issue page, so that all the information is transparent to all the contributors and is auto-archived on the Github.
If you wish to use email, please contact:Leo Yang (leo19941227@gmail.com)Andy T. Liu (liuandyt@gmail.com)Star HistoryContribution (pull request)Guidelines:If you want to add new features (e.g. new upstream), please discuss with us on the Github issue page first before implementing the actual pull request. So we can discuss about whether we want the feauture, how to achieve the feature, and whether the feature is maintainable. (As S3PRL is growing too large, we might not consider new tasks or complex new features.) Thanks!Reporting bugs or the PR fixing the bugs is always welcome!Steps:Create a personal forkof themain S3PRL repositoryin GitHub.Make your changes in a named branch different frommaster, e.g. you create a branchnew-awesome-feature.Contact us if you have any questions during development.Generate a pull requestthrough the Web interface of GitHub.Please verify that your code is free of basic mistakes, we appreciate your contribution!Environment compatibilitiesWe support the following environments. The test cases are ran withtoxlocally and ongithub action:Envversionsosubuntu-18.04,ubuntu-20.04python3.7,3.8,3.9,3.10pytorch1.8.1,1.9.1,1.10.2,1.11.0,1.12.1,1.13.1,2.0.1,2.1.0Change LogDec 2023: Support Multi-resolution HuBERT (MR-HuBERT, seeMultiresolution HuBERT)Oct 2023: Support ESPnet pre-trained upstream models (seeESPnet HuBERTandWavLabLM)Sep 2022: We upgrade the codebase to support testing, documentation and a news3prl PyPI packagefor easy installation and usage for upstream models. See ouronline docfor more information.Mar 2022: IntroduceSUPERB-SG, seeSpeech TranslationbyHsiang-Sheng Tsai,Out-of-domain ASRbyHeng-Jui Chang,Voice ConversionbyWen-Chin Huang,Speech SeparationandSpeech EnhancementbyZili Huangfor more info.Nov 2021: IntroduceS3PRL-VCbyWen-Chin Huang, seeAny-to-onefor more info. We highly recommend to consider thenewly released official repo of S3PRL-VCwhich is developed and actively maintained byWen-Chin Huang. The standalone repo contains much more recepies for the VC experiments. In S3PRL we only include the Any-to-one recipe for reproducing the SUPERB results.Oct 2021: SupportDistilHuBERTbyHeng-Jui Chang, seedocsfor more infoSep 2021:We host achallengeinAAAI workshop: The 2nd Self-supervised Learning for Audio and Speech Processing! SeeSUPERB official sitefor the challenge details and theSUPERB documentationin this toolkit!Aug 2021:We now have a tutorial that introduces our toolkit, you canwatch it on Youtube!July 2021:We are now working on packaging s3prl and reorganizing the file structure inv0.3. Please consider using the stablev0.2.0for now. We will test and releasev0.3before August.June 2021:SupportSUPERB:Speech processingUniversalPERformanceBenchmark, submitted to Interspeech 2021. Use the tagsuperb-interspeech2021orv0.2.0. The individual task contributors include:Shu-wen (Leo) Yang,Pohan Chi,Yist Lin,Yung-Sung Chuang,Jiatong Shi,Xuankai,Wei-Cheng Tsengand Tzu-Hsien Huang.June 2021:Support extracting multiple hidden states from the SSL pretrained modelsJan 2021:Readme updated with detailed instructions on how to use our latest version!Dec 2020:We are migrating to a newer version for a more general, flexible, and scalable code. See the introduction below for more information! The legacy version can be accessed the tagv0.1.0.Oct 2020:We added lots of classic upstream models, including PASE+, APC, VQ-APC, NPC, wav2vec, vq-wav2vec ...etc.Oct 2019:Andy T. Liu,Shu-wen (Leo) YangandPohan Chiimplemented the Mockingjay pre-training and several simple downstream evaluation tasks. This work was the very start of the S3PRL project which established lots of foundamental modules and coding styles. Feel free to checkout to the oldest commits to explore our legacy codebase!Introduction and UsagesThis is an open source toolkit calleds3prl, which stands forSelf-SupervisedSpeechPre-training andRepresentationLearning.
Self-supervised speech pre-trained models are calledupstreamin this toolkit, and are utilized in variousdownstreamtasks.The toolkit hasthree major usages:PretrainPretrain upstream models, including Mockingjay, Audio ALBERT and TERA.Document:pretrain/README.mdUpstreamEasily load most of the existing upstream models with pretrained weights in a unified I/O interface.Pretrained models are registered throughtorch.hub, which means you can use these models in your own project by one-line plug-and-play without depending on this toolkit's coding style.Document:upstream/README.mdDownstreamUtilize upstream models in lots of downstream tasksBenchmark upstream models withSUPERB BenchmarkDocument:downstream/README.mdBelow is anintuitive illustrationon how this toolkit may help you:Feel free to use or modify our toolkit in your research. Here is alist of papers using our toolkit. Any question, bug report or improvement suggestion is welcome throughopening up a new issue.If you find this toolkit helpful to your research, please do consider citingour papers, thanks!InstallationPython>= 3.6Installsoxon your OSInstall s3prl:Read docorpip install -e ".[all]"(Optional) Some upstream models require special dependencies. If you encounter error with a specific upstream model, you can look into theREADME.mdunder eachupstreamfolder. E.g.,upstream/pase/README.md=Reference RepositoriesPytorch, Pytorch.Audio, Pytorch.Kaldi, Kaldi-ASR.Transformers, Hugging Face.PyTorch-Kaldi, Mirco Ravanelli.fairseq, Facebook AI Research.CPC, Facebook AI Research.APC, Yu-An Chung.VQ-APC, Yu-An Chung.NPC, Alexander-H-Liu.End-to-end-ASR-Pytorch, Alexander-H-LiuMockingjay, Andy T. Liu.ESPnet, Shinji Watanabespeech-representations, aws labPASE, Santiago Pascual and Mirco RavanelliLibriMix, Joris Cosentino and Manuel ParienteLicenseThe majority of S3PRL Toolkit is licensed under the Apache License version 2.0, however all the files authored by Facebook, Inc. (which have explicit copyright statement on the top) are licensed under CC-BY-NC.Used byList of papers that used our toolkit (Feel free to add your own paper by making a pull request)Self-Supervised PretrainingMockingjay: Unsupervised Speech Representation Learning with Deep Bidirectional Transformer Encoders (Liu et al., 2020)@article{mockingjay,
   title={Mockingjay: Unsupervised Speech Representation Learning with Deep Bidirectional Transformer Encoders},
   ISBN={9781509066315},
   url={http://dx.doi.org/10.1109/ICASSP40776.2020.9054458},
   DOI={10.1109/icassp40776.2020.9054458},
   journal={ICASSP 2020 - 2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
   publisher={IEEE},
   author={Liu, Andy T. and Yang, Shu-wen and Chi, Po-Han and Hsu, Po-chun and Lee, Hung-yi},
   year={2020},
   month={May}
}TERA: Self-Supervised Learning of Transformer Encoder Representation for Speech (Liu et al., 2020)@misc{tera,
    title={TERA: Self-Supervised Learning of Transformer Encoder Representation for Speech},
    author={Andy T. Liu and Shang-Wen Li and Hung-yi Lee},
    year={2020},
    eprint={2007.06028},
    archivePrefix={arXiv},
    primaryClass={eess.AS}
}Audio ALBERT: A Lite BERT for Self-supervised Learning of Audio Representation (Chi et al., 2020)@inproceedings{audio_albert,
    title={Audio ALBERT: A Lite BERT for Self-supervised Learning of Audio Representation},
    author={Po-Han Chi and Pei-Hung Chung and Tsung-Han Wu and Chun-Cheng Hsieh and Shang-Wen Li and Hung-yi Lee},
    year={2020},
    booktitle={SLT 2020},
}ExplanabilityUnderstanding Self-Attention of Self-Supervised Audio Transformers (Yang et al., 2020)@inproceedings{understanding_sat,
    author={Shu-wen Yang and Andy T. Liu and Hung-yi Lee},
    title={{Understanding Self-Attention of Self-Supervised Audio Transformers}},
    year=2020,
    booktitle={Proc. Interspeech 2020},
    pages={3785--3789},
    doi={10.21437/Interspeech.2020-2231},
    url={http://dx.doi.org/10.21437/Interspeech.2020-2231}
}Adversarial AttackDefense for Black-box Attacks on Anti-spoofing Models by Self-Supervised Learning (Wu et al., 2020), code for computing LNSR:utility/observe_lnsr.py@inproceedings{mockingjay_defense,
    author={Haibin Wu and Andy T. Liu and Hung-yi Lee},
    title={{Defense for Black-Box Attacks on Anti-Spoofing Models by Self-Supervised Learning}},
    year=2020,
    booktitle={Proc. Interspeech 2020},
    pages={3780--3784},
    doi={10.21437/Interspeech.2020-2026},
    url={http://dx.doi.org/10.21437/Interspeech.2020-2026}
}Adversarial Defense for Automatic Speaker Verification by Cascaded Self-Supervised Learning Models (Wu et al., 2021)@misc{asv_ssl,
    title={Adversarial defense for automatic speaker verification by cascaded self-supervised learning models},
    author={Haibin Wu and Xu Li and Andy T. Liu and Zhiyong Wu and Helen Meng and Hung-yi Lee},
    year={2021},
    eprint={2102.07047},
    archivePrefix={arXiv},
    primaryClass={eess.AS}Voice ConversionS2VC: A Framework for Any-to-Any Voice Conversion with Self-Supervised Pretrained Representations (Lin et al., 2021)@misc{s2vc,
      title={S2VC: A Framework for Any-to-Any Voice Conversion with Self-Supervised Pretrained Representations},
      author={Jheng-hao Lin and Yist Y. Lin and Chung-Ming Chien and Hung-yi Lee},
      year={2021},
      eprint={2104.02901},
      archivePrefix={arXiv},
      primaryClass={eess.AS}
}Benchmark and EvaluationSUPERB: Speech processing Universal PERformance Benchmark (Yang et al., 2021)@misc{superb,
      title={SUPERB: Speech processing Universal PERformance Benchmark},
      author={Shu-wen Yang and Po-Han Chi and Yung-Sung Chuang and Cheng-I Jeff Lai and Kushal Lakhotia and Yist Y. Lin and Andy T. Liu and Jiatong Shi and Xuankai Chang and Guan-Ting Lin and Tzu-Hsien Huang and Wei-Cheng Tseng and Ko-tik Lee and Da-Rong Liu and Zili Huang and Shuyan Dong and Shang-Wen Li and Shinji Watanabe and Abdelrahman Mohamed and Hung-yi Lee},
      year={2021},
      eprint={2105.01051},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}Utilizing Self-supervised Representations for MOS Prediction (Tseng et al., 2021)@misc{ssr_mos,
    title={Utilizing Self-supervised Representations for MOS Prediction},
    author={Wei-Cheng Tseng and Chien-yu Huang and Wei-Tsung Kao and Yist Y. Lin and Hung-yi Lee},
    year={2021},
    eprint={2104.03017},
    archivePrefix={arXiv},
    primaryClass={eess.AS}
}}CitationIf you find this toolkit useful, please consider citing following papers.If you use our pre-training scripts, or the downstream tasks considered inTERAandMockingjay, please consider citing the following:@misc{tera,
  title={TERA: Self-Supervised Learning of Transformer Encoder Representation for Speech},
  author={Andy T. Liu and Shang-Wen Li and Hung-yi Lee},
  year={2020},
  eprint={2007.06028},
  archivePrefix={arXiv},
  primaryClass={eess.AS}
}@article{mockingjay,
   title={Mockingjay: Unsupervised Speech Representation Learning with Deep Bidirectional Transformer Encoders},
   ISBN={9781509066315},
   url={http://dx.doi.org/10.1109/ICASSP40776.2020.9054458},
   DOI={10.1109/icassp40776.2020.9054458},
   journal={ICASSP 2020 - 2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
   publisher={IEEE},
   author={Liu, Andy T. and Yang, Shu-wen and Chi, Po-Han and Hsu, Po-chun and Lee, Hung-yi},
   year={2020},
   month={May}
}If you use our organized upstream interface and features, or theSUPERBdownstream benchmark, please consider citing the following:@inproceedings{yang21c_interspeech,
  author={Shu-wen Yang and Po-Han Chi and Yung-Sung Chuang and Cheng-I Jeff Lai and Kushal Lakhotia and Yist Y. Lin and Andy T. Liu and Jiatong Shi and Xuankai Chang and Guan-Ting Lin and Tzu-Hsien Huang and Wei-Cheng Tseng and Ko-tik Lee and Da-Rong Liu and Zili Huang and Shuyan Dong and Shang-Wen Li and Shinji Watanabe and Abdelrahman Mohamed and Hung-yi Lee},
  title={{SUPERB: Speech Processing Universal PERformance Benchmark}},
  year=2021,
  booktitle={Proc. Interspeech 2021},
  pages={1194--1198},
  doi={10.21437/Interspeech.2021-1775}
}