malaya icon indicating copy to clipboard operation
malaya copied to clipboard

AttributeError: Module 'scipy' has no attribute 'asarray'

Open MagusWyvern opened this issue 5 months ago • 2 comments

This is somehow related to the same file mentioned in #165 . Also seems pretty easy to fix - just have to import the specific asarray module from scipy. This is a well known issue with scipy, see this post on SO

Fail yang bermasalah itu ialah malaya/graph/fast_pagerank.py

Traceback (most recent call last):
  File "/root/test.py", line 40, in <module>
    r = model.sentence_level(isu_kerajaan)
  File "/root/pr/lib/python3.10/site-packages/herpetologist/__init__.py", line 100, in check
    return func(*args, **kwargs)
  File "/root/pr/lib/python3.10/site-packages/malaya/model/extractive_summarization.py", line 212, in sentence_level
    original_strings, ranked_sentences, top_words, cluster_top_words = self._vectorize_sentence(
  File "/root/pr/lib/python3.10/site-packages/malaya/model/extractive_summarization.py", line 132, in _vectorize_sentence
    scores = pagerank(similar + 1e-6, retry, **kwargs)
  File "/root/pr/lib/python3.10/site-packages/malaya/graph/pagerank.py", line 19, in pagerank
    r = load_fast_pagerank.pagerank(G, **kwargs)
  File "/root/pr/lib/python3.10/site-packages/malaya/graph/fast_pagerank.py", line 37, in pagerank
    r = sp.asarray(A.sum(axis=1)).reshape(-1)
  File "/root/pr/lib/python3.10/site-packages/scipy/__init__.py", line 139, in __getattr__
    raise AttributeError(
AttributeError: Module 'scipy' has no attribute 'asarray'

MagusWyvern avatar Jan 29 '24 15:01 MagusWyvern