Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DavIvek committed Dec 4, 2024
1 parent 2569680 commit bf1ba0b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions vector_search_example/vector_search_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -159,9 +159,12 @@
"driver = neo4j.GraphDatabase.driver(\"bolt://localhost:7687\", auth=(\"\", \"\"))\n",
"with driver.session() as session:\n",
" for index, row in nolan_movies.iterrows():\n",
" # remove quotes from the title to avoid parsing issues\n",
" row[\"Title\"] = row[\"Title\"].replace('\"', '')\n",
" \n",
" embedding = embeddings[index].tolist()\n",
" embeddings_str = \",\".join([str(x) for x in embedding])\n",
" query = f\"CREATE (m:Movie {{title: '{row['Title']}', year: {row['Release Year']}, embedding: [{embeddings_str}]}})\"\n",
" query = f'CREATE (m:Movie {{title: \"{row[\"Title\"]}\", year: {row[\"Release Year\"]}, embedding: [{embeddings_str}]}})'\n",
" print(query)\n",
" session.run(query)"
]
Expand Down

0 comments on commit bf1ba0b

Please sign in to comment.