Comments (1)
Found the issue...
Function extractTextBody()
in textract_util.py assumes that a scanned page will have child blocks (e.g. LINES, WORDS) in the relationships
property. However, if a scanned document has a blank page, no relationships
key will be present.
Here's an example of the PAGE block throwing my error from a blank scanned page:
{
'BlockType':'PAGE',
'Geometry':{
'BoundingBox':{
'Width':1.0,
'Height':1.0,
'Left':0.0,
'Top':0.0
},
'Polygon':[
{
'X':1.0,
'Y':0.622184693813324
},
{
'X':0.3762473165988922,
'Y':1.0
},
{
'X':0.0,
'Y':0.3771035075187683
},
{
'X':0.6218673586845398,
'Y':0.0
}
]
},
'Id':'25bfd28a-ddea-40db-9d90-9c3237510dc5',
'Page':10
}
In my example, I am testing with docs provided by financial institutions that occasionally have blank pages at the end of a document or between sections. There's no easy way to avoid these blank pages so suggestion is that the extractTextBody()
be modified to check whether the relationships
key is present before proceeding.
from amazon-textract-enhancer.
Related Issues (13)
- Process fails when input file contains spaces HOT 2
- Stack fails to launch when NewDocumentBucketNeeded = false
- KeyError: 'Blocks' bash: KeyError:: command not found
- README.md error about synchronous calls
- Non-provisionable CFN stack
- Please make the solution available on other region
- Cloudformation deployment error? (Unable to access the S3 bucket for the original python code) HOT 1
- S3 Event sends URL encoded key names, causing Lambda handler to fail on Textract API calls HOT 2
- Feature request - Add API authentication or make API private
- Issue with Policy Names
- The stack fails when we change the region.
- Overly permissive IAM permission
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-textract-enhancer.