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 11 months ago
0
Follow
I am building a query engine with
I am building a query engine with
Inactive
0
Follow
B
Bhavya Giri
11 months ago
Β·
I am building a query engine with LlamaIndex, based on a large database of PDFs, and I would like to be able to retrieve the page number with the sources @Logan M
r
B
L
4 comments
Share
Open in Discord
r
richard1861
11 months ago
Hello, you can use the metadata. You should define the metadata when you build the nodes. Later you can just put after you get the response:
Show cited passages that were used to construct the response.
for node in streaming_response.source_nodes:
print(f"Metadata: {node.metadata}")
B
Bhavya Giri
11 months ago
yes, I am asking with reader should i use to get page number which i can add to metadata
L
Logan M
11 months ago
I think the pdf reader automatically splits by page and puts the page number in the metadata
Otherwise, you might have to write your own little loader to set the Metadata how you want
B
Bhavya Giri
11 months ago
okay okay thanks, yeah found that
Add a reply
Sign up and join the conversation on Discord
Join on Discord