Resources / Blog

The Importance of Spatially Aware Named Entity Recognition (Spatial NER)

Named Entity Recognition (NER) is a well-established information retrieval task that involves locating and classifying types of text. The extracted regions correspond to entities, which may be, for instance, people, places, monetary values, organizations, or dates (Wikipedia 2021). 

But traditional NER often assumes clearer training instructions than exist in the real world. 

For example, a relatively straightforward task could be extracting the tax value from receipts.  Even though the receipts may have ‘tax’ in different places based on their individual receipt format, an algorithm can find and catalog the tax information with relatively simple instructions.

Spatial NER

Extraction becomes much more challenging when an algorithm needs to understand the context of an entity based on where it is on the page. That’s where Spatial NER comes in.

Think of the way a human reads text, automatically understanding a bolded headline, indentations in a table, bulleted lists, all-caps text, etc. This understanding is implicit for humans. There is context that the human brain processes without thinking about it.

In a recent interview, Infinia ML VP of Data Science, Ya Xue PhD, had this to say about the complexity of spatial NER:

“People have the wrong impression that data extraction is a keyword search – the word or phrase exists in the document explicitly and you just need to find where it is. 

Many of our extraction tasks are implicit and require a certain level of reasoning. Where content falls on a page, bolding, indentation, bullets and tables, sub-headings – all of these variables provide context that enables meaningful extraction.”

Putting Spatial NER To The Test

To test the effectiveness of Spatial NER on the Infinia ML IDP platform, we compared our extraction results with two popular IDP industry leaders.

Test Document

The image below shows an original file of medical lab results. This type of file will be familiar to anyone who has ever had blood work done in a lab.

test doc spatial NER

TEST 1 – Vendor Alpha

The image below reflects the results from a mainstream extraction program used by many companies today.

Alpha Lab Extraction

You can see in the red highlighted boxes where Alpha got the extraction wrong because their algorithm did not properly understand spatial NER

  1. Alpha incorrectly merged a heading and a sub-head to create “SERUM HIV SERUM HIV”
  2. Row labels across the first page and second page are inconsistent. Second page merges “Normal” and “Abnormal” into the same column.
  3. Zip code treated as a header. Because a zip code appears at the top of the test document, the machine seems to think that it’s a column header. Any human reader would understand that the zip code is a separate piece of information that doesn’t belong here.
  4. “Blood Chemistry Profile” is a subheading in the document but treated as a one of the lab results

TEST 2 – Vendor Beta

Lab Extraction Beta

Beta’s extraction was more promising than Alpha’s, but you can still see where it misunderstood headings and incorrectly merged cells. 

  1. Similar to Alpha, Beta  incorrectly merged a heading and a sub-head to create “SERUM HIV SERUM HIV”
  2. The software split one column – “Reference/Cutoff” – into two columns, the second one it chose to name “Unnamed: 4”
  3. “Blood Chemistry Profile” is a subheading in the document but treated as a one of the lab results

Taken alone, these mistakes might not seem like a big deal, but imagine if your job is to process thousands of documents and correct each mistake by hand through human-in-the-loop quality control.

TEST 3 – Infinia ML IDP

We sent the same file through the Infinia ML Intelligent Document Processing platform and got the following results.

Lab extraction infinia
  1. Algorithm recognizes and subhead and removes it
  2. Maintains consistent column headers across pages

The algorithm understood when text was a subhead and how each column was titled, without human intervention. 

When companies undertake complex extraction, it’s important to understand that off-the-shelf solutions (Alpha and Beta) will only take them so far. Those vendors can be a good choice if a company has fewer documents to process and they aren’t processing on an ongoing basis. 

However, if document processing is part of an ongoing workflow, buyers would be wise to discuss spatial NER with their vendor before implementing it. 

Learn more about how intelligent document processing works at Infinia ML.

Facebook
Twitter
LinkedIn