yeyupiaoling / PPASR

基于PaddlePaddle实现端到端中文语音识别,从入门到实战,超简单的入门案例,超实用的企业项目。支持当前最流行的DeepSpeech2、Conformer、Squeezeformer模型
Apache License 2.0
807 stars 128 forks source link

对文本添加标点符号失败 #85

Closed billqu01 closed 2 years ago

billqu01 commented 2 years ago

我用下面方式给文本添加标点符号,运行报错,请问如何解决? 代码: import ppasr from ppasr.utils.text_utils import PunctuationExecutor

pun_executor = PunctuationExecutor(model_dir='models/pun_models')
result = pun_executor(text)
print(result)

报错: E0624 20:27:29.660760 12207 analysis_config.cc:95] Please compile with gpu to EnableGpu() [2022-06-24 20:27:35,527] [ INFO] - Downloading https://bj.bcebos.com/paddlenlp/models/transformers/ernie/vocab.txt and saved to /home/qugang/.paddlenlp/models/ernie-1.0 [2022-06-24 20:27:35,608] [ INFO] - Downloading vocab.txt from https://bj.bcebos.com/paddlenlp/models/transformers/ernie/vocab.txt 100%|██████████| 89.5k/89.5k [00:00<00:00, 462kB/s] None 'NoneType' object has no attribute 'lower'

yeyupiaoling commented 2 years ago

报的是空指针异常。你的文本呢?

billqu01 commented 2 years ago

谢谢,我明白问题出在哪里了。