chunk_overlap=0)docs = text_splitter.split_documents(documents)from langchain.embeddings import TensorflowHubEmbeddingsembeddings = HuggingFaceEmbeddings()db = ScaNN.from_documents(docs, embeddings)query = "What did the president say about Ketanji Brown Jackson"docs = db.similarity_search(query)docs[0]    Document(page_content='Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you‚Äôre at it, pass the Disclose Act so Americans can know who is funding our elections. \n\nTonight, I‚Äôd like to honor someone who has dedicated his life to serve this country: Justice Stephen Breyer‚Äîan Army veteran, Constitutional scholar, and retiring Justice of the United States Supreme Court. Justice Breyer, thank you for your service. \n\nOne of the most serious constitutional responsibilities a President has is nominating someone to serve on the United States Supreme Court. \n\nAnd I did that 4 days ago, when I nominated Circuit Court of Appeals Judge Ketanji Brown Jackson. One of our nation‚Äôs top legal minds, who will continue Justice Breyer‚Äôs legacy of excellence.', metadata={'source': 'state_of_the_union.txt'})RetrievalQA Demo‚ÄãNext, we demonstrate using ScaNN in conjunction with Google PaLM API.You can obtain an API key from https://developers.generativeai.google/tutorials/setupfrom langchain.chains import RetrievalQAfrom langchain.chat_models import google_palmpalm_client = google_palm.ChatGooglePalm(google_api_key='YOUR_GOOGLE_PALM_API_KEY')qa = RetrievalQA.from_chain_type(    llm=palm_client,    chain_type="stuff",    retriever=db.as_retriever(search_kwargs={'k': 10}))print(qa.run('What did the president say about Ketanji Brown Jackson?'))    The president said that Ketanji Brown Jackson is one of our nation's top legal minds, who will continue Justice Breyer's legacy of excellence.print(qa.run('What did the president say about Michael Phelps?'))    The president did not mention Michael Phelps in his
ScaNN (Scalable Nearest Neighbors) is a method for efficient vector similarity search at scale.
ScaNN (Scalable Nearest Neighbors) is a method for efficient vector similarity search at scale. ->: chunk_overlap=0)docs = text_splitter.split_documents(documents)from langchain.embeddings import TensorflowHubEmbeddingsembeddings = HuggingFaceEmbeddings()db = ScaNN.from_documents(docs, embeddings)query = "What did the president say about Ketanji Brown Jackson"docs = db.similarity_search(query)docs[0]    Document(page_content='Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you‚Äôre at it, pass the Disclose Act so Americans can know who is funding our elections. \n\nTonight, I‚Äôd like to honor someone who has dedicated his life to serve this country: Justice Stephen Breyer‚Äîan Army veteran, Constitutional scholar, and retiring Justice of the United States Supreme Court. Justice Breyer, thank you for your service. \n\nOne of the most serious constitutional responsibilities a President has is nominating someone to serve on the United States Supreme Court. \n\nAnd I did that 4 days ago, when I nominated Circuit Court of Appeals Judge Ketanji Brown Jackson. One of our nation‚Äôs top legal minds, who will continue Justice Breyer‚Äôs legacy of excellence.', metadata={'source': 'state_of_the_union.txt'})RetrievalQA Demo‚ÄãNext, we demonstrate using ScaNN in conjunction with Google PaLM API.You can obtain an API key from https://developers.generativeai.google/tutorials/setupfrom langchain.chains import RetrievalQAfrom langchain.chat_models import google_palmpalm_client = google_palm.ChatGooglePalm(google_api_key='YOUR_GOOGLE_PALM_API_KEY')qa = RetrievalQA.from_chain_type(    llm=palm_client,    chain_type="stuff",    retriever=db.as_retriever(search_kwargs={'k': 10}))print(qa.run('What did the president say about Ketanji Brown Jackson?'))    The president said that Ketanji Brown Jackson is one of our nation's top legal minds, who will continue Justice Breyer's legacy of excellence.print(qa.run('What did the president say about Michael Phelps?'))    The president did not mention Michael Phelps in his