PaddlePaddle / PaddleSpeech

Easy-to-use Speech Toolkit including Self-Supervised Learning model, SOTA/Streaming ASR with punctuation, Streaming TTS with text frontend, Speaker Verification System, End-to-End Speech Translation and Keyword Spotting. Won NAACL2022 Best Demo Award.
https://paddlespeech.readthedocs.io
Apache License 2.0
11.15k stars 1.85k forks source link

如何通过Python API调用conformer_talcs中英文混合语音识别微调模型进行inference #3132

Open choshiho opened 1 year ago

choshiho commented 1 year ago

General Question

预训练模型数据集:TALCS dataset(https://ai.100tal.com/dataset) 预训练模型:PaddleSpeech/examples/tal_cs/asr1/exp/conformer/checkpoints/avg_10.pdparams 微调数据集:使用Audacity软件录制的采样率为16kHz、单声道的共计3945个特定领域的wav文件。 硬件配置:英伟达3090显卡 24GB显存 卡数:单卡 训练时长:30个epoch 模型参数:官方conformer.yaml文件

如何使用Python API调用训练好的微调模型进行inference

import paddle from paddlespeech.cli.asr import ASRExecutor asr_executor = ASRExecutor() text = asr_executor( model='conformer_talcs', lang='zh_en', sample_rate=16000, config=None, ckpt_path=None, audio_file='./ch_zh_mix.wav', codeswitch=True, force_yes=False, device=paddle.get_device()) print('ASR Result: \n{}'.format(text))

请问此处的各个参数需要如何设置,才能调用自己的微调模型进行预测。

zxcd commented 1 year ago

可以参考这个https://github.com/PaddlePaddle/PaddleSpeech/issues/2326 或者修改MODEL_HOME

choshiho commented 1 year ago

可以参考这个#2326 或者修改MODEL_HOME

能麻烦您直接举个例子可以吗?我是自己训练的中英文混合语音识别模型,跟上边的例子不一样。 PaddleSpeech的官方文档对初学者确实不太友好,明明加一两句话就能帮助初学者做的更好的,感觉像故意藏着掖着一样。

zh794390558 commented 1 year ago

具体可以参考参看代码: https://github.com/PaddlePaddle/PaddleSpeech/blob/develop/paddlespeech/cli/asr/infer.py#L132

结合pdb照着修改即可。

choshiho commented 1 year ago

具体可以参考参看代码: https://github.com/PaddlePaddle/PaddleSpeech/blob/develop/paddlespeech/cli/asr/infer.py#L132

结合pdb照着修改即可。

你们可以提供一个Python API调用conformer_talcs中英文混合语音识别微调模型进行推理吗?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.