You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Code used for execution: The original code has a quite modular structure, that's why I provide a quite similar version of the original to make it possible to run it locally (don't panic if it doesn't work as I wrote it on github itself).
entities = []
nlp = spacy.load("models/ca_core_news_lg-3.2.0/ca_core_news_lg/ca_core_news_lg-3.2.0") --> here you have to put the catalan pipeline name
nlp.add_pipe("textrank")
logger.info("Extracting entities with textrank algorithm")
doc = nlp(content)
entities = getTextRankEntities(doc)
logger.info("Entities extracted")
return entities
With regard to the example data where the exception occurs, I am afraid I cannot provide it. However, you can create a string with text in catalan and pass it to the function runTextRankEntities(content).
For the installation of spacy, the following command was executed: pip install spacy
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
File "/code/nlp/textRankEntities.py", line 51, in runTextRankEntities
File "/usr/local/lib/python3.9/site-packages/spacy/language.py", line 1022, in call
File "/usr/local/lib/python3.9/site-packages/spacy/util.py", line 1617, in raise_error
File "/usr/local/lib/python3.9/site-packages/spacy/language.py", line 1017, in call
File "/usr/local/lib/python3.9/site-packages/pytextrank/base.py", line 253, in call
File "/usr/local/lib/python3.9/site-packages/pytextrank/base.py", line 363, in calc_textrank
File "/usr/local/lib/python3.9/site-packages/pytextrank/base.py", line 548, in _collect_phrases
File "/usr/local/lib/python3.9/site-packages/pytextrank/base.py", line 549, in
File "/usr/local/lib/python3.9/site-packages/pytextrank/base.py", line 592, in _calc_discounted_normalised_rank
ZeroDivisionError: division by zero`
The text was updated successfully, but these errors were encountered: