Highlighting support
When users perform manual review of extractions, source document highlighting can be a powerful.
This is a video of Unstract's Human Quality Review feature that uses LLMWhisperer's Highlighting abilities.
In this article, we explain how you can achieve source document highlighting easily using LLMWhisperer in combination with an LLM.
How Highlighting works
There are two components to making highlighting work: the first is making the data available and the second, the user interface bit where the actual highlighting happens.
Making the data available
- Make LLMWhisperer return line numbers for each of the lines extracted. Hexadecimal line numbers are used to keep the extraction LLM from confusing it with other numbers in the document.
- LLMWhisperer maintains the coordinates of each line in the document. No actual data from the document is stored. Just the line numbers and their respective coordinates from the document.
- When extracting fields, prompt the LLM to include the line numbers from which the field was extracted.
- Call the Highlighting coordinates helper function in the client SDK to get coordinates to highlight in the UI. This takes into account the current size of the document displayed.
Highlighting in the UI
Assuming you're using a web-based front-end, we can help you with the code to get the highlighting done if you are a paying customer. Please reach out to us and we'll help you with this.