(.venv) $ python3
Python 3.11.1 (main, Jan 3 2023, 16:00:30) [Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import harvesttext
>>> para = "上港的武磊和恒大的郜林,谁是中国最好的前锋?那当然是武磊武球王了,他是射手榜第一,原来是弱点的单刀也有了进步"
>>> ht = harvesttext.HarvestText()
>>> ht.extract_keywords(para, 5, method="textrank")
Building prefix dict from the default dictionary ...
Loading model from cache /var/folders/25/11vt3cf12jn7v1z3n8c8wchm0000gn/T/jieba.cache
Loading model cost 0.896 seconds.
Prefix dict has been built successfully.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/xxx/github/networkx/networkx/.venv/lib/python3.11/site-packages/harvesttext/word_discover.py", line 299, in extract_keywords
kwds = textrank(block_words, topK, with_score, window, weighted)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/github/networkx/networkx/.venv/lib/python3.11/site-packages/harvesttext/algorithms/keyword.py", line 31, in textrank
pr = nx.pagerank_scipy(G)
^^^^^^^^^^^^^^^^^
AttributeError: module 'networkx' has no attribute 'pagerank_scipy'
>>>
Solution:
Renamed the method call to the recent name.
Reproduceable Error:
Solution: Renamed the method call to the recent name.