diff --git "a/vector_search.ipynb" "b/vector_search.ipynb" new file mode 100644--- /dev/null +++ "b/vector_search.ipynb" @@ -0,0 +1,5798 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 13, + "id": "c6e15777", + "metadata": {}, + "outputs": [], + "source": [ + "from langchain_community.document_loaders import TextLoader\n", + "from langchain_text_splitters import CharacterTextSplitter\n", + "from langchain_openai import OpenAIEmbeddings\n", + "from langchain_chroma import Chroma\n", + "from langchain_google_genai import GoogleGenerativeAIEmbeddings" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "fe5c1f98", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from dotenv import load_dotenv\n", + "load_dotenv()" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "906f975e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
| \n", + " | isbn13 | \n", + "isbn10 | \n", + "title | \n", + "authors | \n", + "categories | \n", + "thumbnail | \n", + "description | \n", + "published_year | \n", + "average_rating | \n", + "num_pages | \n", + "ratings_count | \n", + "title_and_subtitle | \n", + "tagged_description | \n", + "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", + "9780002005883 | \n", + "0002005883 | \n", + "Gilead | \n", + "Marilynne Robinson | \n", + "Fiction | \n", + "http://books.google.com/books/content?id=KQZCP... | \n", + "A NOVEL THAT READERS and critics have been eag... | \n", + "2004.0 | \n", + "3.85 | \n", + "247.0 | \n", + "361.0 | \n", + "Gilead | \n", + "9780002005883 A NOVEL THAT READERS and critics... | \n", + "
| 1 | \n", + "9780002261982 | \n", + "0002261987 | \n", + "Spider's Web | \n", + "Charles Osborne;Agatha Christie | \n", + "Detective and mystery stories | \n", + "http://books.google.com/books/content?id=gA5GP... | \n", + "A new 'Christie for Christmas' -- a full-lengt... | \n", + "2000.0 | \n", + "3.83 | \n", + "241.0 | \n", + "5164.0 | \n", + "Spider's Web: A Novel | \n", + "9780002261982 A new 'Christie for Christmas' -... | \n", + "
| 2 | \n", + "9780006178736 | \n", + "0006178731 | \n", + "Rage of angels | \n", + "Sidney Sheldon | \n", + "Fiction | \n", + "http://books.google.com/books/content?id=FKo2T... | \n", + "A memorable, mesmerizing heroine Jennifer -- b... | \n", + "1993.0 | \n", + "3.93 | \n", + "512.0 | \n", + "29532.0 | \n", + "Rage of angels | \n", + "9780006178736 A memorable, mesmerizing heroine... | \n", + "
| 3 | \n", + "9780006280897 | \n", + "0006280897 | \n", + "The Four Loves | \n", + "Clive Staples Lewis | \n", + "Christian life | \n", + "http://books.google.com/books/content?id=XhQ5X... | \n", + "Lewis' work on the nature of love divides love... | \n", + "2002.0 | \n", + "4.15 | \n", + "170.0 | \n", + "33684.0 | \n", + "The Four Loves | \n", + "9780006280897 Lewis' work on the nature of lov... | \n", + "
| 4 | \n", + "9780006280934 | \n", + "0006280935 | \n", + "The Problem of Pain | \n", + "Clive Staples Lewis | \n", + "Christian life | \n", + "http://books.google.com/books/content?id=Kk-uV... | \n", + "\"In The Problem of Pain, C.S. Lewis, one of th... | \n", + "2002.0 | \n", + "4.09 | \n", + "176.0 | \n", + "37569.0 | \n", + "The Problem of Pain | \n", + "9780006280934 \"In The Problem of Pain, C.S. Le... | \n", + "
| ... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "
| 5192 | \n", + "9788172235222 | \n", + "8172235224 | \n", + "Mistaken Identity | \n", + "Nayantara Sahgal | \n", + "Indic fiction (English) | \n", + "http://books.google.com/books/content?id=q-tKP... | \n", + "On A Train Journey Home To North India After L... | \n", + "2003.0 | \n", + "2.93 | \n", + "324.0 | \n", + "0.0 | \n", + "Mistaken Identity | \n", + "9788172235222 On A Train Journey Home To North... | \n", + "
| 5193 | \n", + "9788173031014 | \n", + "8173031010 | \n", + "Journey to the East | \n", + "Hermann Hesse | \n", + "Adventure stories | \n", + "http://books.google.com/books/content?id=rq6JP... | \n", + "This book tells the tale of a man who goes on ... | \n", + "2002.0 | \n", + "3.70 | \n", + "175.0 | \n", + "24.0 | \n", + "Journey to the East | \n", + "9788173031014 This book tells the tale of a ma... | \n", + "
| 5194 | \n", + "9788179921623 | \n", + "817992162X | \n", + "The Monk Who Sold His Ferrari: A Fable About F... | \n", + "Robin Sharma | \n", + "Health & Fitness | \n", + "http://books.google.com/books/content?id=c_7mf... | \n", + "Wisdom to Create a Life of Passion, Purpose, a... | \n", + "2003.0 | \n", + "3.82 | \n", + "198.0 | \n", + "1568.0 | \n", + "The Monk Who Sold His Ferrari: A Fable About F... | \n", + "9788179921623 Wisdom to Create a Life of Passi... | \n", + "
| 5195 | \n", + "9788185300535 | \n", + "8185300534 | \n", + "I Am that | \n", + "Sri Nisargadatta Maharaj;Sudhakar S. Dikshit | \n", + "Philosophy | \n", + "http://books.google.com/books/content?id=Fv_JP... | \n", + "This collection of the timeless teachings of o... | \n", + "1999.0 | \n", + "4.51 | \n", + "531.0 | \n", + "104.0 | \n", + "I Am that: Talks with Sri Nisargadatta Maharaj | \n", + "9788185300535 This collection of the timeless ... | \n", + "
| 5196 | \n", + "9789027712059 | \n", + "9027712050 | \n", + "The Berlin Phenomenology | \n", + "Georg Wilhelm Friedrich Hegel | \n", + "History | \n", + "http://books.google.com/books/content?id=Vy7Sk... | \n", + "Since the three volume edition ofHegel's Philo... | \n", + "1981.0 | \n", + "0.00 | \n", + "210.0 | \n", + "0.0 | \n", + "The Berlin Phenomenology | \n", + "9789027712059 Since the three volume edition o... | \n", + "
5197 rows × 13 columns
\n", + "