he guys. I am using the following line(PDFReader) in order to load my pdf file as input data:
now my question is that how I can use just first page or a specific page of my file during querying it?
in the following you can see how i make index and other stuff:
PDFReader = download_loader("PDFReader")
`loader = PDFReader()
`documents = loader.load_data(file=Path('/content/4.pdf'))
service_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model, chunk_size=256, chunk_overlap=50)
index = VectorStoreIndex.from_documents(documents, service_context=service_context)
query_engine = index.as_query_engine(llm=llm)
invoice_type = query_engine.query("""
What is the month and year of the period of consumption of this invoice?
I want just dates as your response without words
""")
I mean how I can use just data presented in first page of pdf, because in some cases there are some similar text in differen page that make the llm confuse but I now in advance the related data is in which page