Description
Hi,
I use this library together with spacy for the extraction of the most important words. However, when using the catalan model of spacy, the algorithm gives the following error:
`File "/code/app.py", line 20, in getNlpEntities
entities = runTextRankEntities(hl, contents['contents'], algorithm, num)
File "/code/nlp/textRankEntities.py", line 51, in runTextRankEntities
doc = nlp(joined_content)
File "/usr/local/lib/python3.9/site-packages/spacy/language.py", line 1022, in call
error_handler(name, proc, [doc], e)
File "/usr/local/lib/python3.9/site-packages/spacy/util.py", line 1617, in raise_error
raise e
File "/usr/local/lib/python3.9/site-packages/spacy/language.py", line 1017, in call
doc = proc(doc, **component_cfg.get(name, {})) # type: ignore[call-arg]
File "/usr/local/lib/python3.9/site-packages/pytextrank/base.py", line 253, in call
doc._.phrases = doc._.textrank.calc_textrank()
File "/usr/local/lib/python3.9/site-packages/pytextrank/base.py", line 363, in calc_textrank
nc_phrases = self._collect_phrases(self.doc.noun_chunks, self.ranks)
File "/usr/local/lib/python3.9/site-packages/pytextrank/base.py", line 548, in _collect_phrases
return {
File "/usr/local/lib/python3.9/site-packages/pytextrank/base.py", line 549, in
span: self._calc_discounted_normalised_rank(span, sum_rank)
File "/usr/local/lib/python3.9/site-packages/pytextrank/base.py", line 592, in _calc_discounted_normalised_rank
phrase_rank = math.sqrt(sum_rank / (len(span) + non_lemma))
ZeroDivisionError: division by zero`