Comments (5)
@AdritaBarua By looking at the number shown in the status bar, I guess you are trying to generate samples where the target graph is undirected and the source graph is directed. This will bring up this problem since the "find_path_between_pair" tries to find a path starting from the "first_node" and ending in "second_node". When the target graph is undirected, there is no direction between the two nodes of an edge, and if the source graph is directed, the "second_node" may not be in the neighbors collected by graph.neighbors(first_node)
.
So to avoid this error, you may try target-source graphs as "directed-directed", "directed-undirected" or "undirected-undirected" instead of "undirected-directed". If you want to implement the "undirected-directed" collection, you may modify the following code
first_neighbors = set(graph.neighbors(first_node))
first_neighbors.remove(second_node)
second_neighbors = set(graph.neighbors(second_node) if not graph.is_directed() else graph.predecessors(second_node))
second_neighbors.remove(first_node)
into
first_neighbors = set(graph.neighbors(first_node))
if second_node in first_neighbors:
first_neighbors.remove(second_node)
second_neighbors = set(graph.neighbors(second_node) if not graph.is_directed() else graph.predecessors(second_node))
if first_node in second_neighbors:
second_neighbors.remove(first_node)
from deer.
Thanks for your response, we tried all the possibilities, and even with digraph-digraph, still we are getting the same error. and the previous run was for undirected-undirected. Could you please let us know where we have a problem, that we are getting this error?
from deer.
@AdritaBarua To run for undirected-undirected, you may place the generated "graph.pickle" under the "extract_wiki" folder and then run python extract_wiki.py collect_sample false false 0.75
. This command works on my computer.
from deer.
@ZhuKerui We generated the "graph.pickle", but the error for running collect_sample as you can see in the screenshot is for the " Key error: Henry II, Duke of Bavaria"
from deer.
@sanazskn Hi, could you please show me the complete error message and the command you use to run the script? Thanks.
from deer.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deer.