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)
        ]);
已提问 2 年前771 查看次数
2 回答
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
已回答 2 年前
  • 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
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则