fix syntax (#1380)

This commit is contained in:
danial-openai 2024-08-16 12:21:27 -07:00 committed by GitHub
parent f9a0459885
commit 627a11cb2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,7 +42,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "8d8810f9",
"metadata": {},
"outputs": [],
@ -53,7 +53,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 23,
"id": "5be94df6",
"metadata": {
"ExecuteTime": {
@ -90,7 +90,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 24,
"id": "5dff8b55",
"metadata": {
"ExecuteTime": {
@ -112,7 +112,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 25,
"id": "21097972",
"metadata": {
"ExecuteTime": {
@ -129,7 +129,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 26,
"id": "70bbd8ba",
"metadata": {
"ExecuteTime": {
@ -144,7 +144,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 27,
"id": "1721e45d",
"metadata": {
"ExecuteTime": {
@ -268,7 +268,7 @@
"4 [0.021524671465158463, 0.018522677943110466, -... 4 "
]
},
"execution_count": 92,
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
@ -279,7 +279,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 28,
"id": "960b82af",
"metadata": {
"ExecuteTime": {
@ -299,7 +299,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 29,
"id": "a334ab8b",
"metadata": {
"ExecuteTime": {
@ -364,7 +364,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 30,
"id": "76d697e9",
"metadata": {
"ExecuteTime": {
@ -379,7 +379,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 31,
"id": "1deeb539",
"metadata": {
"ExecuteTime": {
@ -391,10 +391,10 @@
{
"data": {
"text/plain": [
"CollectionsResponse(collections=[])"
"CollectionsResponse(collections=[CollectionDescription(name='Articles')])"
]
},
"execution_count": 96,
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
@ -417,7 +417,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 32,
"id": "1a84ee1d",
"metadata": {
"ExecuteTime": {
@ -432,7 +432,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 33,
"id": "00876f92",
"metadata": {
"ExecuteTime": {
@ -447,7 +447,7 @@
"True"
]
},
"execution_count": 98,
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
@ -474,7 +474,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 34,
"id": "9f39a8c395554ca3",
"metadata": {
"ExecuteTime": {
@ -489,7 +489,7 @@
"True"
]
},
"execution_count": 99,
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
@ -522,7 +522,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 35,
"id": "f24e76ab",
"metadata": {
"ExecuteTime": {
@ -535,7 +535,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Upserting articles: 100%|██████████| 25000/25000 [01:34<00:00, 264.52it/s]\n"
"Upserting articles: 100%|██████████| 25000/25000 [01:18<00:00, 318.84it/s]\n"
]
}
],
@ -568,7 +568,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 36,
"id": "d1188a12",
"metadata": {
"ExecuteTime": {
@ -583,7 +583,7 @@
"CountResult(count=25000)"
]
},
"execution_count": 101,
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
@ -605,7 +605,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 37,
"id": "f1bac4ef",
"metadata": {
"ExecuteTime": {
@ -637,7 +637,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 39,
"id": "aa92f3d3",
"metadata": {
"ExecuteTime": {
@ -658,7 +658,7 @@
"6. Hellenistic art, URL: https://simple.wikipedia.org/wiki/Hellenistic%20art (Score: 0.853)\n",
"7. Modernist literature, URL: https://simple.wikipedia.org/wiki/Modernist%20literature (Score: 0.847)\n",
"8. Art film, URL: https://simple.wikipedia.org/wiki/Art%20film (Score: 0.843)\n",
"9. Central Europe, URL: https://simple.wikipedia.org/wiki/Central%20Europe (Score: 0.842)\n",
"9. Central Europe, URL: https://simple.wikipedia.org/wiki/Central%20Europe (Score: 0.843)\n",
"10. European, URL: https://simple.wikipedia.org/wiki/European (Score: 0.841)\n",
"11. Art, URL: https://simple.wikipedia.org/wiki/Art (Score: 0.841)\n",
"12. Byzantine art, URL: https://simple.wikipedia.org/wiki/Byzantine%20art (Score: 0.841)\n",
@ -676,12 +676,12 @@
"source": [
"query_results = query_qdrant('modern art in Europe', 'Articles', 'title')\n",
"for i, article in enumerate(query_results):\n",
" print(f'{i + 1}. {article.payload[\"title\"]}, URL: {article.payload['url']} (Score: {round(article.score, 3)})')"
" print(f'{i + 1}. {article.payload[\"title\"]}, URL: {article.payload[\"url\"]} (Score: {round(article.score, 3)})')"
]
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 40,
"id": "7ed116b8",
"metadata": {
"ExecuteTime": {
@ -696,7 +696,7 @@
"text": [
"1. Battle of Bannockburn, URL: https://simple.wikipedia.org/wiki/Battle%20of%20Bannockburn (Score: 0.869)\n",
"2. Wars of Scottish Independence, URL: https://simple.wikipedia.org/wiki/Wars%20of%20Scottish%20Independence (Score: 0.861)\n",
"3. 1651, URL: https://simple.wikipedia.org/wiki/1651 (Score: 0.852)\n",
"3. 1651, URL: https://simple.wikipedia.org/wiki/1651 (Score: 0.853)\n",
"4. First War of Scottish Independence, URL: https://simple.wikipedia.org/wiki/First%20War%20of%20Scottish%20Independence (Score: 0.85)\n",
"5. Robert I of Scotland, URL: https://simple.wikipedia.org/wiki/Robert%20I%20of%20Scotland (Score: 0.846)\n",
"6. 841, URL: https://simple.wikipedia.org/wiki/841 (Score: 0.844)\n",
@ -721,7 +721,7 @@
"# This time we'll query using content vector\n",
"query_results = query_qdrant('Famous battles in Scottish history', 'Articles', 'content')\n",
"for i, article in enumerate(query_results):\n",
" print(f'{i + 1}. {article.payload[\"title\"]}, URL: {article.payload['url']} (Score: {round(article.score, 3)})')"
" print(f'{i + 1}. {article.payload[\"title\"]}, URL: {article.payload[\"url\"]} (Score: {round(article.score, 3)})')"
]
},
{