语音识别技术paddlespeech的安装和使用

PaddleSpeech 介绍

PaddleSpeech是百度飞桨(PaddlePaddle)开源深度学习平台的其中一个项目,它基于飞桨的语音方向模型库,用于语音和音频中的各种关键任务的开发,包含大量基于深度学习前沿和有影响力的模型。PaddleSpeech支持语音识别、语音翻译(英译中)、语音合成、标点恢复等应用示例。

安装paddlespeech

PaddleSpeech 快速安装方式有两种,一种是 pip 安装,一种是源码编译(官方推荐)。

使用pip安装paddlespeech

bash 复制代码
$ pip install pytest-runner
$ pip3 install paddleaudio==1.0.1
$ pip3 install paddlespeech==1.0.1

使用源码编译安装

bash 复制代码
$ git clone https://github.com/PaddlePaddle/PaddleSpeech.git
$ cd PaddleSpeech
$ pip install pytest-runner
$ pip install .

提示:安装过程可能因为缺少各种的库报错,如:librosa 依赖的系统库,gcc 环境问题,kaldi 安装等可以在网上查找。

音频示例下载

bash 复制代码
$ wget -c https://paddlespeech.bj.bcebos.com/PaddleAudio/zh.wav
$ wget -c https://paddlespeech.bj.bcebos.com/PaddleAudio/en.wav

paddlespeech工具

查看帮助

bash 复制代码
$ paddlespeech  help
$ paddlespeech asr help

基本使用

语音合成

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

如果报错

bash 复制代码
$ pip install numpy==1.23.0
$ sudo apt-get install libsndfile1

执行过程

bash 复制代码
$  ts-paddle /paddle/PaddleSpeech paddlespeech tts --input "你好,欢迎使用百度飞桨深度学习框架!" --output output.wav
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
/usr/local/lib/python3.7/dist-packages/librosa/core/constantq.py:1059: DeprecationWarning: `np.complex` is a deprecated alias for the builtin `complex`. To silence this warning, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  dtype=np.complex,
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 489M/489M [01:01<00:00, 7.96MB/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 915M/915M [01:51<00:00, 8.22MB/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 589M/589M [01:01<00:00, 9.57MB/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 107k/107k [00:00<00:00, 1.33MB/s]
W0606 13:22:41.408085  2451 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.7, Runtime API Version: 11.7
W0606 13:22:41.412684  2451 gpu_resources.cc:91] device: 0, cuDNN Version: 8.4.
/paddle/PaddleSpeech/output.wavλ ts-paddle /paddle/PaddleSpeech ls

语音识别

识别中文

bash 复制代码
$ paddlespeech asr --lang zh --input zh.wav

指定模型识别,识别英文

bash 复制代码
$ paddlespeech  asr --lang en --model deepspeech2offline_librispeech  --input en.wav

标点恢复

恢复文本标点,可与ASR模型配合使用

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

声音分类

适配多场景的开放领域声音分类工具

基于 AudioSet 数据集 527 个类别的声音分类模型

bash 复制代码
$ paddlespeech cls --input zh.wav

声纹提取

工业级声纹提取工具

bash 复制代码
$ paddlespeech vector --task spk --input zh.wav

语音翻译

端到端英译中语音翻译工具,使用预编译的 kaldi 相关工具,只支持在 Ubuntu 系统中体验

bash 复制代码
$ paddlespeech st --input en.wav
相关推荐
Shockang1 分钟前
假设检验与置信区间在机器学习中的应用
人工智能·数学·机器学习·概率统计
新智元12 分钟前
Manus 火到国外?网友实测惊呆!00 后博士生 0 天复刻霸榜开源第一
人工智能·openai
程序员安仔14 分钟前
保姆级教程!零代码小白用 Trae 做出 3 个爆款工具实录
人工智能
机器之心16 分钟前
7B 级形式化推理与验证小模型,媲美满血版 DeepSeek-R1,全面开源!
人工智能·openai
阿_旭30 分钟前
基于YOLO11深度学习的运动品牌LOGO检测与识别系统【python源码+Pyqt5界面+数据集+训练代码】
人工智能·python·深度学习·毕业设计·logo检测
SomeB1oody31 分钟前
【Python机器学习】1.9. 逻辑回归实战(进阶):建立二阶边界模型
人工智能·python·机器学习·ai·逻辑回归
东临碣石8236 分钟前
【AI论文】GEN3C: 基于3D信息的全球一致视频生成技术,实现精确相机控制
人工智能·数码相机·3d
源码姑娘43 分钟前
基于OpenCV的车牌识别系统(源码+论文+部署教程)
人工智能·毕业设计
我码玄黄44 分钟前
大模型时代,为什么模型都是多少B?
人工智能·llm
Dmatteratall1 小时前
目标检测热力图的生成代码(基于GridCam)生成的
人工智能·目标检测·计算机视觉