Closed billqu01 closed 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'
报的是空指针异常。你的文本呢?
谢谢,我明白问题出在哪里了。
我用下面方式给文本添加标点符号,运行报错,请问如何解决? 代码: import ppasr from ppasr.utils.text_utils import PunctuationExecutor
报错: 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'