Skip to content

Commit

Permalink
add graph visual
Browse files Browse the repository at this point in the history
  • Loading branch information
gkorland committed Aug 30, 2023
1 parent 0754997 commit c003c82
Show file tree
Hide file tree
Showing 2 changed files with 523 additions and 12 deletions.
71 changes: 59 additions & 12 deletions docs/examples/index_structs/knowledge_graph/FalkorDBGraphDemo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"id": "f1a9eb90-335c-4214-8bb6-fd1edbe3ccbd",
"metadata": {},
"outputs": [],
Expand All @@ -26,7 +26,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"id": "88a9f2e3-c729-455a-a338-2f83776c1d4c",
"metadata": {},
"outputs": [],
Expand All @@ -50,7 +50,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"id": "71c8a77a",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -79,7 +79,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"id": "8d0b2364-4806-4656-81e7-3f6e4b910b5b",
"metadata": {},
"outputs": [],
Expand All @@ -96,7 +96,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"id": "1c297fd3-3424-41d8-9d0d-25fe6310ab62",
"metadata": {
"tags": []
Expand All @@ -110,7 +110,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"id": "61679142-7595-492b-8792-26cbc439caf8",
"metadata": {},
"outputs": [],
Expand All @@ -123,7 +123,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"id": "370fd08f-56ff-4c24-b0c4-c93116a6d482",
"metadata": {
"tags": []
Expand Down Expand Up @@ -156,7 +156,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"id": "670300d8-d0a8-4201-bbcd-4a74b199fcdd",
"metadata": {},
"outputs": [],
Expand All @@ -169,7 +169,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"id": "eecf2d57-3efa-4b0d-941a-95438d42893c",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -201,7 +201,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"id": "bd14686d-1c53-4637-9340-3745f2121ae2",
"metadata": {},
"outputs": [],
Expand All @@ -214,13 +214,60 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"id": "b4c87d14-d2d8-4d80-89f6-1e5972973528",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/markdown": [
"<b>Interleaf was a company that had smart people and built impressive technology. However, it faced challenges and eventually got crushed by Moore's Law. The exponential growth in the power of commodity processors, particularly Intel processors, in the 1990s led to the consolidation of high-end, special-purpose hardware and software companies. Interleaf was one of the casualties of this trend. While the company had talented individuals and advanced technology, it was unable to compete with the rapid advancements in processor power.</b>"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display(Markdown(f\"<b>{response}</b>\"))"
]
},
{
"cell_type": "markdown",
"id": "9225c416",
"metadata": {},
"source": [
"#### Visualizing the Graph"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9505a3a0",
"metadata": {},
"outputs": [],
"source": [
"%pip install pyvis"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8d2341a1",
"metadata": {},
"outputs": [],
"source": [
"## create graph\n",
"from pyvis.network import Network\n",
"\n",
"g = index.get_networkx_graph()\n",
"net = Network(notebook=True, cdn_resources=\"in_line\", directed=True)\n",
"net.from_nx(g)\n",
"net.show(\"falkordbgraph_draw.html\")"
]
}
],
"metadata": {
Expand Down
464 changes: 464 additions & 0 deletions docs/examples/index_structs/knowledge_graph/falkordbgraph_draw.html

Large diffs are not rendered by default.

0 comments on commit c003c82

Please sign in to comment.