- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.9k
 
PaddleSpeech CLI Architecture
        Hui Zhang edited this page Feb 11, 2022 
        ·
        12 revisions
      
    - 从用户体验角度考虑,需要给每个模型实现单条推理功能。
 - 语音模型需要全量接入 PaddleHub 中。
 - 模型组合使用完成高阶应用案例。
 
PaddleSpeech 新增 CLI 一站式语音工具箱。
CLI 统一管理所有语音模型的单条推理,维护预训练模型下载,设计清晰、可维护、可扩展,满足上述需求。
安装 PaddleSpeech 包:
pip install paddlespeech
ASR+Punc应用示例:
from paddlespeech.cli import ASRExecutor
from paddlespeech.cli import TextExecutor
if __name__ == "__main__":
    asr_executor = ASRExecutor()
    text_executor = TextExecutor()
    text = asr_executor(
        audio_file=os.path.abspath(os.path.expanduser(args.input)),
        device=args.device)
    result = text_executor(
        text=text,
        task='punc',
        model='ernie_linear_p3_wudao',
        device=args.device)
    print('ASR Result: \n{}'.format(text))
    print('ASR with Punc Result: \n{}'.format(result))
