From 1ce12c7a6a0cf2276c7f5352cd726d4946e19b58 Mon Sep 17 00:00:00 2001 From: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com> Date: Wed, 3 Apr 2024 14:27:43 +0200 Subject: [PATCH] Remove example (#7458) --- .../in_memory_bm25_documentsearch.py | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 examples/retrievers/in_memory_bm25_documentsearch.py diff --git a/examples/retrievers/in_memory_bm25_documentsearch.py b/examples/retrievers/in_memory_bm25_documentsearch.py deleted file mode 100644 index 2b8ee66e84..0000000000 --- a/examples/retrievers/in_memory_bm25_documentsearch.py +++ /dev/null @@ -1,27 +0,0 @@ -from haystack import Document, Pipeline -from haystack.components.retrievers.in_memory import InMemoryBM25Retriever -from haystack.document_stores.in_memory import InMemoryDocumentStore - -# Create components and a query pipeline -document_store = InMemoryDocumentStore() -retriever = InMemoryBM25Retriever(document_store=document_store) - -pipeline = Pipeline() -pipeline.add_component(instance=retriever, name="retriever") - -# Add Documents -documents = [ - Document(content="There are over 7,000 languages spoken around the world today."), - Document( - content="Elephants have been observed to behave in a way that indicates a high level of self-awareness, such as recognizing themselves in mirrors." - ), - Document( - content="In certain parts of the world, like the Maldives, Puerto Rico, and San Diego, you can witness the phenomenon of bioluminescent waves." - ), -] -document_store.write_documents(documents) - -# Run the pipeline -result = pipeline.run(data={"retriever": {"query": "How many languages are there?"}}) - -print(result["retriever"]["documents"][0])