dmmiller612 / bert-extractive-summarizer

Easy to use extractive text summarization with BERT
MIT License
1.38k stars 305 forks source link

spacy attribute error #99

Closed muvazima closed 3 years ago

muvazima commented 3 years ago

File "/opt/anaconda3/lib/python3.8/site-packages/summarizer/model_processors.py", line 116, in call return self.run(body, ratio, min_length, max_length, algorithm=algorithm, use_first=use_first) File "/opt/anaconda3/lib/python3.8/site-packages/summarizer/model_processors.py", line 87, in run sentences = self.sentence_handler(body, min_length, max_length) File "/opt/anaconda3/lib/python3.8/site-packages/summarizer/sentence_handler.py", line 24, in call return self.process(body, min_length, max_length) File "/opt/anaconda3/lib/python3.8/site-packages/summarizer/sentence_handler.py", line 21, in process return [c.string.strip() for c in doc.sents if max_length > len(c.string.strip()) > min_length] File "/opt/anaconda3/lib/python3.8/site-packages/summarizer/sentence_handler.py", line 21, in return [c.string.strip() for c in doc.sents if max_length > len(c.string.strip()) > min_length] AttributeError: 'spacy.tokens.span.Span' object has no attribute 'string'

dmmiller612 commented 3 years ago

As of last night, I just merged in code to support Spacy 3.0 with the sentence handler. You will need to install bert-extractive-summarizer==0.7.0