Spaces:
Sleeping
Sleeping
Update graph_utils.py
Browse files- graph_utils.py +3 -3
graph_utils.py
CHANGED
|
@@ -12,9 +12,9 @@ def get_graph_dict(graph_text):
|
|
| 12 |
|
| 13 |
else:
|
| 14 |
try:
|
| 15 |
-
for trpl in graph_text[1:-1].split("
|
| 16 |
-
h,r,t = trpl
|
| 17 |
-
edge_labels[(h,t)] = r
|
| 18 |
except:
|
| 19 |
edge_labels = {("Error", None):None}
|
| 20 |
return edge_labels
|
|
|
|
| 12 |
|
| 13 |
else:
|
| 14 |
try:
|
| 15 |
+
for trpl in graph_text[1:-1].split(", "):
|
| 16 |
+
h,r,t = trpl.split(" : ")
|
| 17 |
+
edge_labels[(h,t)] = "_".join(r.split(" "))
|
| 18 |
except:
|
| 19 |
edge_labels = {("Error", None):None}
|
| 20 |
return edge_labels
|