|
42 | 42 | },
|
43 | 43 | {
|
44 | 44 | "cell_type": "code",
|
45 |
| - "execution_count": 1, |
| 45 | + "execution_count": null, |
46 | 46 | "id": "8d8810f9",
|
47 | 47 | "metadata": {},
|
48 | 48 | "outputs": [],
|
|
53 | 53 | },
|
54 | 54 | {
|
55 | 55 | "cell_type": "code",
|
56 |
| - "execution_count": 2, |
| 56 | + "execution_count": 23, |
57 | 57 | "id": "5be94df6",
|
58 | 58 | "metadata": {
|
59 | 59 | "ExecuteTime": {
|
|
90 | 90 | },
|
91 | 91 | {
|
92 | 92 | "cell_type": "code",
|
93 |
| - "execution_count": 3, |
| 93 | + "execution_count": 24, |
94 | 94 | "id": "5dff8b55",
|
95 | 95 | "metadata": {
|
96 | 96 | "ExecuteTime": {
|
|
112 | 112 | },
|
113 | 113 | {
|
114 | 114 | "cell_type": "code",
|
115 |
| - "execution_count": 4, |
| 115 | + "execution_count": 25, |
116 | 116 | "id": "21097972",
|
117 | 117 | "metadata": {
|
118 | 118 | "ExecuteTime": {
|
|
129 | 129 | },
|
130 | 130 | {
|
131 | 131 | "cell_type": "code",
|
132 |
| - "execution_count": 5, |
| 132 | + "execution_count": 26, |
133 | 133 | "id": "70bbd8ba",
|
134 | 134 | "metadata": {
|
135 | 135 | "ExecuteTime": {
|
|
144 | 144 | },
|
145 | 145 | {
|
146 | 146 | "cell_type": "code",
|
147 |
| - "execution_count": 6, |
| 147 | + "execution_count": 27, |
148 | 148 | "id": "1721e45d",
|
149 | 149 | "metadata": {
|
150 | 150 | "ExecuteTime": {
|
|
268 | 268 | "4 [0.021524671465158463, 0.018522677943110466, -... 4 "
|
269 | 269 | ]
|
270 | 270 | },
|
271 |
| - "execution_count": 92, |
| 271 | + "execution_count": 27, |
272 | 272 | "metadata": {},
|
273 | 273 | "output_type": "execute_result"
|
274 | 274 | }
|
|
279 | 279 | },
|
280 | 280 | {
|
281 | 281 | "cell_type": "code",
|
282 |
| - "execution_count": 7, |
| 282 | + "execution_count": 28, |
283 | 283 | "id": "960b82af",
|
284 | 284 | "metadata": {
|
285 | 285 | "ExecuteTime": {
|
|
299 | 299 | },
|
300 | 300 | {
|
301 | 301 | "cell_type": "code",
|
302 |
| - "execution_count": 8, |
| 302 | + "execution_count": 29, |
303 | 303 | "id": "a334ab8b",
|
304 | 304 | "metadata": {
|
305 | 305 | "ExecuteTime": {
|
|
364 | 364 | },
|
365 | 365 | {
|
366 | 366 | "cell_type": "code",
|
367 |
| - "execution_count": 9, |
| 367 | + "execution_count": 30, |
368 | 368 | "id": "76d697e9",
|
369 | 369 | "metadata": {
|
370 | 370 | "ExecuteTime": {
|
|
379 | 379 | },
|
380 | 380 | {
|
381 | 381 | "cell_type": "code",
|
382 |
| - "execution_count": 10, |
| 382 | + "execution_count": 31, |
383 | 383 | "id": "1deeb539",
|
384 | 384 | "metadata": {
|
385 | 385 | "ExecuteTime": {
|
|
391 | 391 | {
|
392 | 392 | "data": {
|
393 | 393 | "text/plain": [
|
394 |
| - "CollectionsResponse(collections=[])" |
| 394 | + "CollectionsResponse(collections=[CollectionDescription(name='Articles')])" |
395 | 395 | ]
|
396 | 396 | },
|
397 |
| - "execution_count": 96, |
| 397 | + "execution_count": 31, |
398 | 398 | "metadata": {},
|
399 | 399 | "output_type": "execute_result"
|
400 | 400 | }
|
|
417 | 417 | },
|
418 | 418 | {
|
419 | 419 | "cell_type": "code",
|
420 |
| - "execution_count": 11, |
| 420 | + "execution_count": 32, |
421 | 421 | "id": "1a84ee1d",
|
422 | 422 | "metadata": {
|
423 | 423 | "ExecuteTime": {
|
|
432 | 432 | },
|
433 | 433 | {
|
434 | 434 | "cell_type": "code",
|
435 |
| - "execution_count": 12, |
| 435 | + "execution_count": 33, |
436 | 436 | "id": "00876f92",
|
437 | 437 | "metadata": {
|
438 | 438 | "ExecuteTime": {
|
|
447 | 447 | "True"
|
448 | 448 | ]
|
449 | 449 | },
|
450 |
| - "execution_count": 98, |
| 450 | + "execution_count": 33, |
451 | 451 | "metadata": {},
|
452 | 452 | "output_type": "execute_result"
|
453 | 453 | }
|
|
474 | 474 | },
|
475 | 475 | {
|
476 | 476 | "cell_type": "code",
|
477 |
| - "execution_count": 13, |
| 477 | + "execution_count": 34, |
478 | 478 | "id": "9f39a8c395554ca3",
|
479 | 479 | "metadata": {
|
480 | 480 | "ExecuteTime": {
|
|
489 | 489 | "True"
|
490 | 490 | ]
|
491 | 491 | },
|
492 |
| - "execution_count": 99, |
| 492 | + "execution_count": 34, |
493 | 493 | "metadata": {},
|
494 | 494 | "output_type": "execute_result"
|
495 | 495 | }
|
|
522 | 522 | },
|
523 | 523 | {
|
524 | 524 | "cell_type": "code",
|
525 |
| - "execution_count": 14, |
| 525 | + "execution_count": 35, |
526 | 526 | "id": "f24e76ab",
|
527 | 527 | "metadata": {
|
528 | 528 | "ExecuteTime": {
|
|
535 | 535 | "name": "stderr",
|
536 | 536 | "output_type": "stream",
|
537 | 537 | "text": [
|
538 |
| - "Upserting articles: 100%|██████████| 25000/25000 [01:34<00:00, 264.52it/s]\n" |
| 538 | + "Upserting articles: 100%|██████████| 25000/25000 [01:18<00:00, 318.84it/s]\n" |
539 | 539 | ]
|
540 | 540 | }
|
541 | 541 | ],
|
|
568 | 568 | },
|
569 | 569 | {
|
570 | 570 | "cell_type": "code",
|
571 |
| - "execution_count": 15, |
| 571 | + "execution_count": 36, |
572 | 572 | "id": "d1188a12",
|
573 | 573 | "metadata": {
|
574 | 574 | "ExecuteTime": {
|
|
583 | 583 | "CountResult(count=25000)"
|
584 | 584 | ]
|
585 | 585 | },
|
586 |
| - "execution_count": 101, |
| 586 | + "execution_count": 36, |
587 | 587 | "metadata": {},
|
588 | 588 | "output_type": "execute_result"
|
589 | 589 | }
|
|
605 | 605 | },
|
606 | 606 | {
|
607 | 607 | "cell_type": "code",
|
608 |
| - "execution_count": 16, |
| 608 | + "execution_count": 37, |
609 | 609 | "id": "f1bac4ef",
|
610 | 610 | "metadata": {
|
611 | 611 | "ExecuteTime": {
|
|
637 | 637 | },
|
638 | 638 | {
|
639 | 639 | "cell_type": "code",
|
640 |
| - "execution_count": 17, |
| 640 | + "execution_count": 39, |
641 | 641 | "id": "aa92f3d3",
|
642 | 642 | "metadata": {
|
643 | 643 | "ExecuteTime": {
|
|
658 | 658 | "6. Hellenistic art, URL: https://simple.wikipedia.org/wiki/Hellenistic%20art (Score: 0.853)\n",
|
659 | 659 | "7. Modernist literature, URL: https://simple.wikipedia.org/wiki/Modernist%20literature (Score: 0.847)\n",
|
660 | 660 | "8. Art film, URL: https://simple.wikipedia.org/wiki/Art%20film (Score: 0.843)\n",
|
661 |
| - "9. Central Europe, URL: https://simple.wikipedia.org/wiki/Central%20Europe (Score: 0.842)\n", |
| 661 | + "9. Central Europe, URL: https://simple.wikipedia.org/wiki/Central%20Europe (Score: 0.843)\n", |
662 | 662 | "10. European, URL: https://simple.wikipedia.org/wiki/European (Score: 0.841)\n",
|
663 | 663 | "11. Art, URL: https://simple.wikipedia.org/wiki/Art (Score: 0.841)\n",
|
664 | 664 | "12. Byzantine art, URL: https://simple.wikipedia.org/wiki/Byzantine%20art (Score: 0.841)\n",
|
|
676 | 676 | "source": [
|
677 | 677 | "query_results = query_qdrant('modern art in Europe', 'Articles', 'title')\n",
|
678 | 678 | "for i, article in enumerate(query_results):\n",
|
679 |
| - " print(f'{i + 1}. {article.payload[\"title\"]}, URL: {article.payload['url']} (Score: {round(article.score, 3)})')" |
| 679 | + " print(f'{i + 1}. {article.payload[\"title\"]}, URL: {article.payload[\"url\"]} (Score: {round(article.score, 3)})')" |
680 | 680 | ]
|
681 | 681 | },
|
682 | 682 | {
|
683 | 683 | "cell_type": "code",
|
684 |
| - "execution_count": 18, |
| 684 | + "execution_count": 40, |
685 | 685 | "id": "7ed116b8",
|
686 | 686 | "metadata": {
|
687 | 687 | "ExecuteTime": {
|
|
696 | 696 | "text": [
|
697 | 697 | "1. Battle of Bannockburn, URL: https://simple.wikipedia.org/wiki/Battle%20of%20Bannockburn (Score: 0.869)\n",
|
698 | 698 | "2. Wars of Scottish Independence, URL: https://simple.wikipedia.org/wiki/Wars%20of%20Scottish%20Independence (Score: 0.861)\n",
|
699 |
| - "3. 1651, URL: https://simple.wikipedia.org/wiki/1651 (Score: 0.852)\n", |
| 699 | + "3. 1651, URL: https://simple.wikipedia.org/wiki/1651 (Score: 0.853)\n", |
700 | 700 | "4. First War of Scottish Independence, URL: https://simple.wikipedia.org/wiki/First%20War%20of%20Scottish%20Independence (Score: 0.85)\n",
|
701 | 701 | "5. Robert I of Scotland, URL: https://simple.wikipedia.org/wiki/Robert%20I%20of%20Scotland (Score: 0.846)\n",
|
702 | 702 | "6. 841, URL: https://simple.wikipedia.org/wiki/841 (Score: 0.844)\n",
|
|
721 | 721 | "# This time we'll query using content vector\n",
|
722 | 722 | "query_results = query_qdrant('Famous battles in Scottish history', 'Articles', 'content')\n",
|
723 | 723 | "for i, article in enumerate(query_results):\n",
|
724 |
| - " print(f'{i + 1}. {article.payload[\"title\"]}, URL: {article.payload['url']} (Score: {round(article.score, 3)})')" |
| 724 | + " print(f'{i + 1}. {article.payload[\"title\"]}, URL: {article.payload[\"url\"]} (Score: {round(article.score, 3)})')" |
725 | 725 | ]
|
726 | 726 | },
|
727 | 727 | {
|
|
0 commit comments