# PDF Text Extraction Is Hard Even for AWS Textract

DevFeed: [PDF Text Extraction Is Hard Even for AWS Textract](<https://devfeed.tech/articles/pdf-text-extraction-is-hard-even-for-aws-textract-28124.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/aws/2020/03/05/pdf-text-extraction-is-hard-even-for-aws-textract.html>)

Author: Fuzzygroup

Published: 2020-03-05T00:00:00Z

Content type: article

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [Amazon Textract](<https://devfeed.tech/topics/amazon-textract.md>), [pdf](<https://devfeed.tech/topics/pdf.md>), [API](<https://devfeed.tech/topics/api.md>), [JSON](<https://devfeed.tech/topics/json.md>), [CSV](<https://devfeed.tech/topics/csv.md>)

Tags: [amazon-textract](<https://devfeed.tech/tags/amazon-textract.md>), [api](<https://devfeed.tech/tags/api.md>), [aws](<https://devfeed.tech/tags/aws.md>), [csv](<https://devfeed.tech/tags/csv.md>), [data](<https://devfeed.tech/tags/data.md>), [json](<https://devfeed.tech/tags/json.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [pdf](<https://devfeed.tech/tags/pdf.md>), [python](<https://devfeed.tech/tags/python.md>)

## AI overview

The article evaluates AWS Textract for extracting email addresses from PDF resumes. In a small sample, a prior technique extracted about 70%, while Textract reduced the failure rate to roughly 10% but still failed on some resumes. It also describes Textract outputs including bounding-box data, semantic key-value fields, and full document text.

## Source excerpt

I have always found that serendipity plays a large role in my technical life. For example I recently ran into a great article and discussion thread on PDF Text Extraction: Article Discussion Thread The thrust of this article amounts to "PDF Processing Is Hard and Here's Why" (tldr - PDF isn't a document format as much as a layout format and how things are laid out generally bears little relationship to their structure as "document elements"). Now lately I've been involved in some resume processing lately and this made me say: Hm... Can I extract just the email addresses programmatically from this stack of resumes? I found that following the techniques in this Medium article, I was able to extract roughly 70% of the email addresses from a small sample. And while 70% isn't bad, I suspected that better should be possible. And that led me to the AWS Textract service. Unfortunately what I found was that even the "machine learning" powered Textract service: Amazon Textract overcomes these challenges by using machine learning to instantly "read" virtually any type of document to accurately extract text and data without the need for any manual effort or custom code. failed to get email addresses reliably out of simple PDF resumes (note - my overall review on Textract is still generally positive; see Conclusion below). The failure rate was better - roughly 10% instead of 30% but it still failed. What I did find fascinating, however, is how AWS Textract works under the hood. There appear to be three results from the Textract API call: apiResponse.json keyValues.csv rawText.txt These three results have different functions: a set of bounding boxes with text elements right down to geometry a set of semantic fields that they found in the document (I generally found this pretty useless; for a resume I would have expected things like contact info to be key values; instead it was a graduation date) the full text of the document Here's an example of the apiResponse.json which was the m