Spaces:
Sleeping
Sleeping
Update graph_utils.py
Browse files- graph_utils.py +1 -0
graph_utils.py
CHANGED
|
@@ -14,6 +14,7 @@ def get_graph_dict(graph_text):
|
|
| 14 |
try:
|
| 15 |
for trpl in graph_text[1:-1].split("), ("):
|
| 16 |
h,r,t = trpl.split(" : ")
|
|
|
|
| 17 |
edge_labels.append((h,t, "_".join(r.split(" "))))
|
| 18 |
except:
|
| 19 |
edge_labels.append(("Error", None, None))
|
|
|
|
| 14 |
try:
|
| 15 |
for trpl in graph_text[1:-1].split("), ("):
|
| 16 |
h,r,t = trpl.split(" : ")
|
| 17 |
+
if t == "none": t = h
|
| 18 |
edge_labels.append((h,t, "_".join(r.split(" "))))
|
| 19 |
except:
|
| 20 |
edge_labels.append(("Error", None, None))
|