Log in
Log into community
Find answers from the community
View all posts
Related posts
Did this answer your question?
π
π
π
Powered by
Hall
Inactive
Updated 10 months ago
0
Follow
Source Nodes
Source Nodes
Inactive
0
Follow
A
AmitKhandey
10 months ago
Β·
I want to log cosine similarity of RAG response while retrieving from chroma db ? Please refer below code for this: .vector_store = self.setup_chroma(collectionName)
storage_context = StorageContext.from_defaults(vector_store=vector_store)
documents = SimpleDirectoryReader(
input_files = files
).load_data()
node_parser = SentenceSplitter(chunk_size=512, chunk_overlap=50)
nodes = node_parser.get_nodes_from_documents(documents)
index = VectorStoreIndex(nodes, storage_context=storage_context)
query_engine = index.as_query_engine()
query_engine.query(query)
W
1 comment
Share
Open in Discord
W
WhiteFang_Jr
10 months ago
You can get the similarity score of each retrieved nodes from the response.
Plain Text
Copy
response= query_engine.query(qry) print(response.source_nodes)
Add a reply
Sign up and join the conversation on Discord
Join on Discord