noc-lab / simple_sentence_segment

A simple sentence segmentation tools
MIT License
9 stars 4 forks source link

ModuleNotFoundError: No module named 'copy_reg\r' error #1

Closed MoAbd closed 5 years ago

MoAbd commented 5 years ago

Full error

ModuleNotFoundError Traceback (most recent call last)

in 4 from IPython.core.display import display, HTML 5 ----> 6 from simple_sentence_segment import sentence_segment 7 from clinical_concept_extraction import clinical_concept_extraction ~\AppData\Local\conda\conda\envs\py3\lib\site-packages\simple_sentence_segment\__init__.py in ----> 1 from .model import sentence_segment 2 from .spacy_pipeline import SentenceSegmenter ~\AppData\Local\conda\conda\envs\py3\lib\site-packages\simple_sentence_segment\model.py in 10 11 if six.PY3: ---> 12 cls = cPickle.load(open(os.path.join(dir_path, 'model/cls.pkl'), 'rb'), encoding='latin1') 13 elif six.PY2: 14 cls = cPickle.load(open(os.path.join(dir_path, 'model/cls.pkl'), 'rb')) ModuleNotFoundError: No module named 'copy_reg\r'
henghuiz-zz commented 5 years ago

Hi @MoAbd. I am aware of this error. This is because it is difficult to serialize a sklearn object. Please try to ensure the version of your scikit-learn is above 0.20. It may be caused by other types of imcompatibility issue.

MoAbd commented 5 years ago

Hello @henghuiz, Thanks for your reply. error is not found when I work on LINUX OS

henghuiz-zz commented 5 years ago

you can try to use the new version by pip install -U git+https://github.com/noc-lab/simple_sentence_segment.git and now I use onnx to solve the compatibility issue. I believe you can run in many different environments.