Open wannian1997 opened 1 year ago
我将这句改为了assert len(mask_id) >= 1,但是这样输出的结果为类似{(8, ''): [('[', 0.8247228860855103), (']', 0.08479063957929611), ('被', 0.006882567889988422), ('/', 0.0036284865345805883), ('『', 0.0036059825215488672)]},缺少了原本的错误的字。
将你的输入文本和测试代码也发一下?不然不好追踪原因。
'import xmnlp modelPath = r"E:\deepLearning\xmnlp-onnx-models" xmnlp.set_model(modelPath) text = "不能适应体育专业选拔人材的要求" print(xmnlp.checker(text))'
Lazy load checker...
Traceback (most recent call last):
File "E:/deepLearning/Bert-Chinese-Text-Classification-Pytorch/toolTest.py", line 6, in
进程已结束,退出代码1
import xmnlp text = "不能适应体育专业选拔人材的要求" File "
", line 1 text = "不能适应体育专业选拔人材的要求" IndentationError: unexpected indent text = "不能适应体育专业选拔人材的要求" print(xmnlp.checker(text)) (Lazy Load) Loading model... start to build dictionary... done ! Traceback (most recent call last): File " ", line 1, in File "C:\Users\l00660157\Anaconda3\envs\labelme\Lib\site-packages\xmnlp__init__.py", line 135, in checker return _checker.check(text, level=level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\l00660157\Anaconda3\envs\labelme\Lib\site-packages\xmnlp\checker__init__.py", line 48, in check return model.best_match(doc) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\l00660157\Anaconda3\envs\labelme\Lib\site-packages\xmnlp\checker\checker.py", line 110, in best_match return self.word_checker(word)[0] TypeError: 'NoneType' object is not subscriptable
我的报这个错误
TypeError: 'NoneType' object is not subscriptable
checker.py文件中50行assert len(mask_id) == 1出现AssertionError请问如何解决