Невозможно импортировать имя «combined_rule_sentence_segmenter» ⇐ Python

Программы на Python
Anonymous
Невозможно импортировать имя «combined_rule_sentence_segmenter»

Сообщение Anonymous »

Я установил все пакеты. при их импорте появляется ошибка типа «невозможно импортировать имя «combined_rule_sentence_segmenter»». Как правильно импортировать пакеты.
!pip install https://s3-us-west-2.amazonaws.com/ai2- ... 2.0.tar.gz
pip install https://s3-us-west-2.amazonaws.com/ai2- ... 2.0.tar.gz
pip install https://s3-us-west-2.amazonaws.com/ai2- ... 2.0.tar.gz
pip install https://s3-us-west-2.amazonaws.com/ai2- ... 2.0.tar.gz

import scispacy
import spacy
from spacy import displacy
from collections import Counter
import en_core_web_sm
import en_ner_bc5cdr_md
import en_core_sci_sm
import en_core_sci_md
import en_ner_bionlp13cg_md
from scispacy.abbreviation import AbbreviationDetector
from scispacy.umls_linking import UmlsEntityLinker
from collections import OrderedDict
from pprint import pprint

/usr/local/lib/python3.6/dist-packages/spacy/util.py:275: UserWarning: [W031] Model 'en_core_web_sm' (2.2.5) requires spaCy v2.2 and is incompatible with the current spaCy version (2.3.2). This may lead to unexpected results or runtime errors. To resolve this, download a newer compatible model or retrain your custom model with the current spaCy version. For more details and available updates, run: python -m spacy validate
warnings.warn(warn_msg)
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
in ()
4 from collections import Counter
5 import en_core_web_sm
----> 6 import en_ner_bc5cdr_md
7 import en_core_sci_sm
8 import en_core_sci_md

/usr/local/lib/python3.6/dist-packages/en_ner_bc5cdr_md/__init__.py in ()
5 from spacy.util import load_model_from_init_py, get_model_meta
6
----> 7 from scispacy.custom_sentence_segmenter import combined_rule_sentence_segmenter
8
9 __version__ = get_model_meta(Path(__file__).parent)['version']

ImportError: cannot import name 'combined_rule_sentence_segmenter'


Подробнее здесь: https://stackoverflow.com/questions/635 ... -segmenter

Вернуться в «Python»