'page': 1})]Sample 3‚ÄãProcessing a multi-page document requires the document to be on S3. The sample document resides in a bucket in us-east-2 and Textract needs to be called in that same region to be successful, so we set the region_name on the client and pass that in to the loader to ensure Textract is called from us-east-2. You could also to have your notebook running in us-east-2, setting the AWS_DEFAULT_REGION set to us-east-2 or when running in a different environment, pass in a boto3 Textract client with that region name like in the cell below.import boto3textract_client = boto3.client('textract', region_name='us-east-2')file_path = "s3://amazon-textract-public-content/langchain/layout-parser-paper.pdf"loader = AmazonTextractPDFLoader(file_path, client=textract_client)documents = loader.load()Now getting the number of pages to validate the response (printing out the full response would be quite long...). We expect 16 pages.len(documents)    16Using the AmazonTextractPDFLoader in an LangChain chain (e. g. OpenAI)‚ÄãThe AmazonTextractPDFLoader can be used in a chain the same way the other loaders are used.
Amazon Textract is a machine learning (ML) service that automatically extracts text, handwriting, and data from scanned documents. It goes beyond simple optical character recognition (OCR) to identify, understand, and extract data from forms and tables. Today, many companies manually extract data from scanned documents such as PDFs, images, tables, and forms, or through simple OCR software that requires manual configuration (which often must be updated when the form changes). To overcome these manual and expensive processes, Textract uses ML to read and process any type of document, accurately extracting text, handwriting, tables, and other data with no manual effort. You can quickly automate document processing and act on the information extracted, whether you‚Äôre automating loans processing or extracting information from invoices and receipts. Textract can extract the data in minutes instead of hours or days.
Amazon Textract is a machine learning (ML) service that automatically extracts text, handwriting, and data from scanned documents. It goes beyond simple optical character recognition (OCR) to identify, understand, and extract data from forms and tables. Today, many companies manually extract data from scanned documents such as PDFs, images, tables, and forms, or through simple OCR software that requires manual configuration (which often must be updated when the form changes). To overcome these manual and expensive processes, Textract uses ML to read and process any type of document, accurately extracting text, handwriting, tables, and other data with no manual effort. You can quickly automate document processing and act on the information extracted, whether you‚Äôre automating loans processing or extracting information from invoices and receipts. Textract can extract the data in minutes instead of hours or days. ->: 'page': 1})]Sample 3‚ÄãProcessing a multi-page document requires the document to be on S3. The sample document resides in a bucket in us-east-2 and Textract needs to be called in that same region to be successful, so we set the region_name on the client and pass that in to the loader to ensure Textract is called from us-east-2. You could also to have your notebook running in us-east-2, setting the AWS_DEFAULT_REGION set to us-east-2 or when running in a different environment, pass in a boto3 Textract client with that region name like in the cell below.import boto3textract_client = boto3.client('textract', region_name='us-east-2')file_path = "s3://amazon-textract-public-content/langchain/layout-parser-paper.pdf"loader = AmazonTextractPDFLoader(file_path, client=textract_client)documents = loader.load()Now getting the number of pages to validate the response (printing out the full response would be quite long...). We expect 16 pages.len(documents)    16Using the AmazonTextractPDFLoader in an LangChain chain (e. g. OpenAI)‚ÄãThe AmazonTextractPDFLoader can be used in a chain the same way the other loaders are used.