Matthew Chan
Matthew Chan

Reputation: 1

How to trace back content origin within a document from the query response of Azure AI Search?

I am only recently introduced to Azure AI Search so please pardon me if this is a trivial question.

When I was studying the demo video from Microsoft, I saw that after the user clicks the citation link returned from ChatGPT, it opened up a page on the right displaying the source origin from the pdf file.

However, I struggle to see how I can jump to the content (like the demo) based on the Azure AI Search Query Result. After importing and vectorizing my data using Azure Console, I can only see chunk, chunk_id, parent_id and title from the API response. The title gives me hint about which document the chunk comes from, but it doesn't mention "where" inside the document. I also noticed the chunk_id has a suffix indicating the page number, but I am not sure if this is the right approach.

So my question is:

  1. Is using suffix of chunk_id the proper way to trace back the location of content within the document?
  2. If not, how can i modify the indexer to include metadata that tells me where it is located inside the document?

I have already spent days looking at Azure document but i struggle to find any reference that answers my question. I have also read about the article text but it doesn't explain very clearly how to define custom retrievable field. Highly appreciate it if anyone can tell me how it is done. Thanks in advance!

Upvotes: 0

Views: 639

Answers (1)

JayashankarGS
JayashankarGS

Reputation: 8055

To obtain a proper citation along with results, you should have the following fields in the index, allowing you to map them when linking your own data to the chat playground in Azure OpenAI service:

  1. Content data
  2. File name
  3. Title
  4. URL

So, whenever you add linking data through AI search, checkmark custom field mapping so that you can select the fields.

enter image description here

Then map them as shown below.

enter image description here

Here, I have selected filepath to File name so that it provides a reference to that file.

Output:

I asked for windows server key features? in the chat.

enter image description here

And in the index:

enter image description here

Upvotes: 1

Related Questions