m = T5Corrector()
res = m.correct_batch(['今天新情很好', '你找到你最喜欢的工作,我也很高心。'])
print(res)
报错:
Traceback (most recent call last):
File "/home/soc/gitcode/github/machine_learning/corrector_text/pycorrector.py", line 3, in
from pycorrector import T5Corrector
File "/home/soc/gitcode/github/machine_learning/corrector_text/pycorrector.py", line 3, in
from pycorrector import T5Corrector
ImportError: cannot import name 'T5Corrector' from partially initialized module 'pycorrector' (most likely due to a circular import) (/home/soc/gitcode/github/machine_learning/corrector_text/pycorrector.py)
from pycorrector import T5Corrector
m = T5Corrector() res = m.correct_batch(['今天新情很好', '你找到你最喜欢的工作,我也很高心。']) print(res)
Traceback (most recent call last): File "/home/soc/gitcode/github/machine_learning/corrector_text/pycorrector.py", line 3, in
from pycorrector import T5Corrector
File "/home/soc/gitcode/github/machine_learning/corrector_text/pycorrector.py", line 3, in
from pycorrector import T5Corrector
ImportError: cannot import name 'T5Corrector' from partially initialized module 'pycorrector' (most likely due to a circular import) (/home/soc/gitcode/github/machine_learning/corrector_text/pycorrector.py)
Name: pycorrector Version: 1.0.4 Summary: Chinese Text Error Corrector Home-page: https://github.com/shibing624/pycorrector Author: XuMing Author-email: xuming624@qq.com License: Apache 2.0 Location: /home/**/machine_learn/lib/python3.8/site-packages Requires: datasets, jieba, loguru, numpy, pandas, pypinyin, six, transformers Required-by: