Skip to content

Commit

Permalink
Update neo4j-document-store.md (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-risch authored Aug 6, 2024
1 parent 217cab4 commit 7af27fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion integrations/neo4j-document-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ docker run \
`Neo4jEmbeddingRetriever` component can be used to retrieve documents from Neo4j by querying vector index using an embedded query. Below is a pipeline which finds documents using query embedding as well as [metadata filtering](https://docs.haystack.deepset.ai/docs/metadata-filtering):

```python
from typing import List

from haystack import Document, Pipeline
from haystack.components.embedders import SentenceTransformersTextEmbedder, SentenceTransformersDocumentEmbedder
from neo4j_haystack import Neo4jEmbeddingRetriever, Neo4jDocumentStore
Expand All @@ -150,7 +152,7 @@ document_store = Neo4jDocumentStore(
documents = [
Document(content="My name is Morgan and I live in Paris.", meta={"release_date": "2018-12-09"})]

document_embedder = SentenceTransformersDocumentEmbedder(model=model_name)
document_embedder = SentenceTransformersDocumentEmbedder(model="sentence-transformers/all-MiniLM-L6-v2")
document_embedder.warm_up()
documents_with_embeddings = document_embedder.run(documents)

Expand Down

0 comments on commit 7af27fe

Please sign in to comment.