SwissText Shared Task on Hierarchical Patent Classification Forum

Go back to competition Back to thread list Post in this thread

> error with the networkx

Hello

I try running the baseline with requirements.txt dependencies installed. But getting error with the nerworkx library.
"AttributeError: 'DiGraph' object has no attribute 'node'"
Has anyone else ecountered the similar error and any resolution you found?

Posted by: subhashpujari @ Feb. 12, 2020, 7:24 a.m.

Hi

Can you post the entire error message?
It could be that it needs to be changed to nodes:
https://networkx.github.io/documentation/stable/_modules/networkx/classes/graph.html#Graph

>>> G.add_node(1, time='5pm')
>>> G.add_nodes_from([3], time='2pm')
>>> G.nodes[1]
{'time': '5pm'}
https://networkx.github.io/documentation/stable/reference/classes/generated/networkx.Graph.nodes.html

Posted by: benf @ Feb. 12, 2020, 7:55 a.m.

Ok I could reproduce that, it is an error on sklearn-hiearachical-classification library (my code part...).
I fixed it, if you reinstall it should work:
pip install -U git+https://github.com/fbenites/sklearn-hierarchical-classification.git#egg=sklearn_hierarchical_classification

Thank you for reporting, and have fun with the competition!

Best,
Fernando

Posted by: benf @ Feb. 12, 2020, 8:11 a.m.
Post in this thread