PaddleSpeech README

The project's README from github.com/PaddlePaddle/PaddleSpeech. As one markdown file: README.md.

(简体中文|English)

Quick Start | Documents | Models List | AIStudio Courses | NAACL2022 Best Demo Award Paper | Gitee


PaddleSpeech is an open-source toolkit on PaddlePaddle platform for a variety of critical tasks in speech and audio, with the state-of-art and influential models.

PaddleSpeech won the NAACL2022 Best Demo Award, please check out our paper on Arxiv.

Speech Recognition
Input Audio Recognition Result

I knocked at the door on the ancient side of the building.

我认为跑步最重要的就是给我带来了身体健康。
Speech Translation (English to Chinese)
Input Audio Translations Result

我 在 这栋 建筑 的 古老 门上 敲门。
Text-to-Speech
Input Text Synthetic Audio
Life was like a box of chocolates, you never know what you're gonna get.
早上好,今天是2020/10/29,最低温度是-3°C。
季姬寂,集鸡,鸡即棘鸡。棘鸡饥叽,季姬及箕稷济鸡。鸡既济,跻姬笈,季姬忌,急咭鸡,鸡急,继圾几,季姬急,即籍箕击鸡,箕疾击几伎,伎即齑,鸡叽集几基,季姬急极屐击鸡,鸡既殛,季姬激,即记《季姬击鸡记》。
大家好,我是 parrot 虚拟老师,我们来读一首诗,我与春风皆过客,I and the spring breeze are passing by,你携秋水揽星河,you take the autumn water to take the galaxy。
宜家唔系事必要你讲,但系你所讲嘅说话将会变成呈堂证供。
各个国家有各个国家嘅国歌

For more synthesized audios, please refer to PaddleSpeech Text-to-Speech samples.

Punctuation Restoration
Input Text Output Text
今天的天气真不错啊你下午有空吗我想约你一起去吃饭 今天的天气真不错啊!你下午有空吗?我想约你一起去吃饭。

Features

Via the easy-to-use, efficient, flexible and scalable implementation, our vision is to empower both industrial application and academic research, including training, inference & testing modules, and deployment process. To be more specific, this toolkit features at:

Recent Update

Community

Installation

We strongly recommend our users to install PaddleSpeech in Linux with python>=3.8.

Dependency Introduction

PaddleSpeech depends on paddlepaddle. For installation, please refer to the official website of paddlepaddle and choose according to your own machine. Here is an example of the cpu version.

pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple

You can also specify the version of paddlepaddle or install the develop version.

# install 2.4.1 version. Note, 2.4.1 is just an example, please follow the minimum dependency of paddlepaddle for your selection
pip install paddlepaddle==2.4.1 -i https://mirror.baidu.com/pypi/simple
# install develop version
pip install paddlepaddle==0.0.0 -f https://www.paddlepaddle.org.cn/whl/linux/cpu-mkl/develop.html

There are two quick installation methods for PaddleSpeech, one is pip installation, and the other is source code compilation (recommended).

pip install

pip install pytest-runner
pip install paddlespeech

source code compilation

git clone https://github.com/PaddlePaddle/PaddleSpeech.git
cd PaddleSpeech
pip install pytest-runner
pip install .
# If you need to install in editable mode, you need to use --use-pep517. The command is as follows:
# pip install -e . --use-pep517

For more installation problems, such as conda environment, librosa-dependent, gcc problems, kaldi installation, etc., you can refer to this installation document. If you encounter problems during installation, you can leave a message on #2150 and find related problems

Quick Start

Developers can have a try of our models with PaddleSpeech Command Line or Python. Change --input to test your own audio/text and support 16k wav format audio.

You can also quickly experience it in AI Studio 👉🏻 PaddleSpeech API Demo

Test audio sample download

wget -c https://paddlespeech.cdn.bcebos.com/PaddleAudio/zh.wav
wget -c https://paddlespeech.cdn.bcebos.com/PaddleAudio/en.wav

Automatic Speech Recognition

 (Click to expand)Open Source Speech Recognition

command line experience

paddlespeech asr --lang zh --input zh.wav

Python API experience

>>> from paddlespeech.cli.asr.infer import ASRExecutor
>>> asr = ASRExecutor()
>>> result = asr(audio_file="zh.wav")
>>> print(result)
我认为跑步最重要的就是给我带来了身体健康

Text-to-Speech

 Open Source Speech Synthesis

Output 24k sample rate wav format audio

command line experience

paddlespeech tts --input "你好,欢迎使用百度飞桨深度学习框架!" --output output.wav

Python API experience

>>> from paddlespeech.cli.tts.infer import TTSExecutor
>>> tts = TTSExecutor()
>>> tts(text="今天天气十分不错。", output="output.wav")

Audio Classification

 An open-domain sound classification tool

Sound classification model based on 527 categories of AudioSet dataset

command line experience

paddlespeech cls --input zh.wav

Python API experience

>>> from paddlespeech.cli.cls.infer import CLSExecutor
>>> cls = CLSExecutor()
>>> result = cls(audio_file="zh.wav")
>>> print(result)
Speech 0.9027186632156372

Voiceprint Extraction

 Industrial-grade voiceprint extraction tool

command line experience

paddlespeech vector --task spk --input zh.wav

Python API experience

>>> from paddlespeech.cli.vector import VectorExecutor
>>> vec = VectorExecutor()
>>> result = vec(audio_file="zh.wav")
>>> print(result) # 187维向量
[ -0.19083306   9.474295   -14.122263    -2.0916545    0.04848729
   4.9295826    1.4780062    0.3733844   10.695862     3.2697146
  -4.48199     -0.6617882   -9.170393   -11.1568775   -1.2358263 ...]

Punctuation Restoration

 Quick recovery of text punctuation, works with ASR models

command line experience

paddlespeech text --task punc --input 今天的天气真不错啊你下午有空吗我想约你一起去吃饭

Python API experience

>>> from paddlespeech.cli.text.infer import TextExecutor
>>> text_punc = TextExecutor()
>>> result = text_punc(text="今天的天气真不错啊你下午有空吗我想约你一起去吃饭")
今天的天气真不错啊!你下午有空吗?我想约你一起去吃饭。

Speech Translation

 End-to-end English to Chinese Speech Translation Tool

Use pre-compiled kaldi related tools, only support experience in Ubuntu system

command line experience

paddlespeech st --input en.wav

Python API experience

>>> from paddlespeech.cli.st.infer import STExecutor
>>> st = STExecutor()
>>> result = st(audio_file="en.wav")
['我 在 这栋 建筑 的 古老 门上 敲门 。']

Quick Start Server

Developers can have a try of our speech server with PaddleSpeech Server Command Line.

You can try it quickly in AI Studio (recommend): SpeechServer

Start server

paddlespeech_server start --config_file ./demos/speech_server/conf/application.yaml

Access Speech Recognition Services

paddlespeech_client asr --server_ip 127.0.0.1 --port 8090 --input input_16k.wav

**Access Text to Sp

PaddleSpeech (PaddlePaddle/PaddleSpeech)

Searching Database…

这是什么?PaddleSpeech 是一个基于 PaddlePaddle 平台构建的开源语音与音频工具包,涵盖自动语音识别(ASR)、语音合成(TTS)、说话人验证、语音翻译、关键词检测和标点恢复等任务。它曾获得 NAACL2022 最佳演示奖。
这是一个 Python 库,还是别的什么?它是一个可以通过 pip 或源码安装的 Python 库/工具包,同时还提供开箱即用的命令行(CLI)命令和可选的服务器(包括流式服务器),因此无需编写代码就能体验这些模型。
我该如何安装和运行它?先安装 PaddlePaddle,然后通过 pip 或从源码编译(推荐)安装 PaddleSpeech,之后即可通过命令行(CLI)或 Python API 调用这些模型。
我需要先安装 PaddlePaddle 并使用特定的 Python 版本吗?是的——你需要 gcc >= 4.8.5、Python >= 3.8,并且要在安装 PaddleSpeech 之前先装好 PaddlePaddle,选择与你的 CPU/GPU 相匹配的 PaddlePaddle 版本。
安装时有哪些需要注意的坑?在 conda 环境、librosa 依赖、gcc 问题以及 Kaldi 配置方面,安装过程可能比较棘手;项目有专门的故障排查文档。另外,语音翻译演示特别需要预编译的 Kaldi 工具,而这些工具只能在 Ubuntu 上运行。
它只能在 Linux 上运行,还是也支持 Windows 和 Mac?推荐使用 Linux,但也支持 Windows 和 Mac OSX。
它开箱即用地支持哪些语音任务?ASR、TTS、说话人验证、关键词检测、音频/声音分类、语音翻译和标点恢复,并且提供面向生产环境的 ASR 和 TTS 流式版本。
它的中文 TTS 有什么特别之处?它内置基于规则的中文文本前端,负责文本规范化和字音转换(grapheme-to-phoneme),并包含针对中文语境定制的多音字和变调规则。
我能克隆声音,或在新说话人上微调 TTS 吗?可以——项目提供语音克隆示例(例如基于 AISHELL-3 并使用 ECAPA-TDNN 说话人编码器)、一套 TTS 微调流程,以及用于语音克隆和语音编辑的 ERNIE-SAT 模型。
它基于哪些底层模型和数据集?它集成了 LibriSpeech、LJSpeech、AIShell 和 CSMSC 等主流数据集,并支持 Conformer、Wav2vec2、HuBERT、WavLM、Whisper 和 VITS 等模型。
Size
71.2 MB
Stars
12.7K
Age
8y
Commits · 90 Days