How to extract Tables and form data using textract

0

Thanks in advance I am new to Textract and using textract along with laravel. While i am extracting Forms or Tables its working but while i passing feature type Tables and Forms api not resulting any response . please help me out. below is input

$result = $this->textract->startDocumentAnalysis([ 'DocumentLocation' => [ # Required 'S3Object' => [ 'Bucket' => config('services.aws.bucket'), 'Name' => "{$file_name}" # Input document

                ]
            ],
            'FeatureTypes' => ['TABLES', 'FORMS'],
            # Required - list of the types of analysis to perform (TEXT included by default)
        ]);
asked 2 years ago766 views
2 Answers
0

Hi, thank you for trying Textract!. Can you share what response you're getting so we can better understand the issue you're seeing? Please keep in mind that startDocumentAnalysis is our async API which means the response you get should have a jobId for which you will have to call GetDocumentAnalysis with in order to get the detection results once the job is completed.

AWS
answered 2 years ago
  • Dear I am using php laravel using below php code for extracting, its working fine for Tables or For Forms. when i using both tables and forms

    1. Not returning GUID. and shows document is under process below is my code $input_type = [];

       if ($type == 'form') {
           $input_type = ['FORMS'];
       } elseif ($type == 'table') {            
           $input_type = ['TABLES'];
       } elseif ($type == 'formtable') {
           $input_type = ['TABLES', 'FORMS'];
           // array_push($input_type, 'TABLES');
           // array_push($input_type, 'FORMS');
       }
      
       try {           
      
           $result = $this->textract->startDocumentAnalysis([
               'DocumentLocation' => [ 										# Required 
                   'S3Object' => [
                       'Bucket' => config('services.aws.bucket'),
                       'Name' => "{$file_name}" # Input document 
                      
                   ]
               ],
               'FeatureTypes' => $input_type,
               # Required - list of the types of analysis to perform (TEXT included by default)
           ]);
      
           # Check Status of startDocumentAnalysis
           $response['status'] = 'success';
           $response['task_id'] = $result['JobId'];
           $response['job_status'] = 'IN_PROGRESS';
           $response['raw'] = '';
      
0

Hi it sounds like you're inquiring that the job is stuck in progress state and never completes. Can you confirm that's the issue?

Please share with us the JobId for the problematic job so we can investigate on our side.

AWS
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions