1

Tried to follow this line of code from this link https://spacy.io/universe/project/spacy-sentence-segmenter to create a sentence segmenter. Encountered the following error:ModuleNotFoundError: No module named 'seg'.

Spacy already installed. Didn't find any information about which module should be used for this 'seg'. Anyone could help? thanks.

from seg.newline.segmenter import NewLineSegmenter
import spacy

nlseg = NewLineSegmenter()
nlp = spacy.load('en')
nlp.add_pipe(nlseg.set_sent_starts, name='sentence_segmenter', before='parser')
doc = nlp(my_doc_text)

2 Answers 2

2

Sentence Segmenter is a third-party module that is different from your spaCy installation. You need to install it separately:

pip install spacyss

You can find more information in the project's Github page.

Sign up to request clarification or add additional context in comments.

Comments

0

Try to install the module using pip or pip3:
pip3 install segmentation

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.