Skip to content

Commit

Permalink
fix: Fix GraphRAG notebook V2 (run-llama#16913)
Browse files Browse the repository at this point in the history
  • Loading branch information
dexters1 authored Nov 11, 2024
1 parent 54edec0 commit 9114604
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/docs/examples/cookbooks/GraphRAG_v2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install llama-index llama-index-graph-stores-neo4j graspologic numpy==1.24.4 scipy==1.12.0"
"!pip install llama-index llama-index-graph-stores-neo4j graspologic numpy==1.24.4 scipy==1.12.0 future"
]
},
{
Expand Down Expand Up @@ -628,10 +628,14 @@
" ).retrieve(query_str)\n",
"\n",
" enitites = set()\n",
" pattern = r\"(\\w+(?:\\s+\\w+)*)\\s*\\({[^}]*}\\)\\s*->\\s*([^(]+?)\\s*\\({[^}]*}\\)\\s*->\\s*(\\w+(?:\\s+\\w+)*)\"\n",
" pattern = (\n",
" r\"^(\\w+(?:\\s+\\w+)*)\\s*->\\s*([a-zA-Z\\s]+?)\\s*->\\s*(\\w+(?:\\s+\\w+)*)$\"\n",
" )\n",
"\n",
" for node in nodes_retrieved:\n",
" matches = re.findall(pattern, node.text, re.DOTALL)\n",
" matches = re.findall(\n",
" pattern, node.text, re.MULTILINE | re.IGNORECASE\n",
" )\n",
"\n",
" for match in matches:\n",
" subject = match[0]\n",
Expand Down

0 comments on commit 9114604

Please sign in to comment.