AI Data Extraction

Today we are learning how to create our very own AI-Powered data extraction bot. This bot uses AI to extract relevant information from a document and helps you find where that information comes from with ease.  

Legal professionals can transform their workflow with this tool that delivers both precision and efficiency. Let’s check its potential on the front end. The first thing we need to do is to upload the document we want to extract information from. 

Right below, we find a dropdown with different pieces of information we may want to extract from the PDF. Simply select your preferred option.

Next, click “Extract information” and in a few seconds the AI does its magic. Here you have your desired information. But that is not all, you can also click on the annotation to see the source and its information, in this case we wanted to see: 

  • The exact page from the document. 
  • The page content. 
  • The name of the file from which the information is extracted. 

Are you impressed? Now it is your turn to build your AI Data Extraction Bot. Let’ do this!

Let’s build this bot step by step!  

Step 1: Define and Upload

As we always do, let’s write a catchy name and a brief description for our bot and consecutively, add a “Text Field” to explain your client  they should upload a DOCx or a PDF file. 

In order for them to provide the file, we need to include a “files” node. We need to remember to toggle the “Use in AI Output” and to select the AI Settings, otherwise the AI will not be able to extract the desired information.  

Step 2:  Choose your extraction target

Continue by adding a dropdown node. Here we will write some pieces of information that can be extracted from the file. Keep in mind that these are the options we considered, but feel free to adjust them to better suit your needs.

Step 3: Configure the AI Engine

Afterwards, it is time to include the “AI Output” node. Select the same “AI Settings” from the “files” node and write concise “default values” such as “Waiting for Input” and “checking data”. 

Next, toggle the “link to files node” and select the file you want the AI to extract the information from. 

Now for the tricky part. The prompt. First, on the “system prompt” ask the AI to extract the defined information, and on the “dynamic prompt” define that information by adding the dropdown variable. By doing this the AI knows that only must extract information relevant to the option selected in the dropdown.

To end up with this node, select “with dedicated button” to trigger the AI, “never” from the second dropdown to prevent accidental retriggering and write a concise button name, something like “extract information”. 

 Step 4: Mapping

To continue, we will use the “node creator” tool, this will help you quickly build the “mapper variable” and its data sources. This will save you time and effort.  

The sources tell us exactly where to find the information within the document. The information we are interested in is the page, text chunk, and the file name. 

Now, as source node choose “ai-output-extraction” and from the “source type dropdown” choose “JSON”. 

Step 5: Display your extracted data

Right below, add a text field node with the extracted information, in other words, with the AI Output variable. 

Step 6: Manage your empty output

After that, include a “logical condition” to prevent the following node from appearing if the mapper variables are empty.  

Step 7: Highlight Source Location

For the final node, include an “annotation” and insert the mapper variables corresponding to the data we want to extract: page, page content and file name. 

Remember, this information will only appear when the AI Output has been generated. 

Finally, we have completed our creation.

Happy automating with e! 

Schedule directly your demo!

Grab a cup of coffee and we will walk you through our tool and answer all your questions. We might also have a seat left on our pilot customer list.

Do not miss the latest LegalTech news and
e! updates!

Subscribe now to our
monthly newsletter