aws-solutions / enhanced-document-understanding-on-aws

Enhanced Document Understanding on AWS delivers an easy-to-use web application that ingests and analyzes documents, extracts content, identifies and redacts sensitive customer information, and creates search indexes from the analyzed data.
https://aws.amazon.com/solutions/implementations/enhanced-document-understanding-on-aws/
Apache License 2.0
32 stars 12 forks source link

Their is some Flag issue in Case Status #79

Open Komal-99 opened 4 days ago

Komal-99 commented 4 days ago

Describe the bug

image Here All Failed cases show Text extracted but the Complete ones show Null, which means no text extraction is performed on this. There is some issue in the flagging function It should be opposite to the current implementation. Also Need Help that After Text extraction Still Raw text is not getting detected in My solution, what could be the Root Cause?

Expected behavior For Cases where Document text extraction is Complete, It should show the Status as complete

Please complete the following information about the solution:

mukitmomin commented 2 days ago

Hi @Komal-99 thanks for opening the issue. We will investigate and reach out to you for more info or questions.

Komal-99 commented 2 days ago

Also @mukitmomin
Can You help in reviewing this code function ,

def start_job(token: str, case_id: str):
    # Prepare the request body with the provided case_id
    request_body = {
        "caseId": case_id
    }

    # The API endpoint for starting the job
    start_job_api = f"{REST_API_ENDPOINT}/case/start-job"

    # Headers with the Authorization token and Content-Type
    headers = {
        "Authorization": token,
        "Content-Type": "application/json"
    }
    # Send the POST request
    response = requests.post(start_job_api, json=request_body, headers=headers)

    try:
        # Check if the request was successful
        if response.status_code == 200:
            # Parse and return the JSON response
            response_data = response.json()
            print(f"Response Data: {response_data}")
            return response_data
        else:
            # Handle non-200 status codes
            print(f"Error in start job: {response.status_code} - {response.text}")
            return None
    except Exception as e:
        print(f"Exception: {e}")
        print(f"Response Content: {response.content}")
        return None

for Starting Job after Uploading the document Successfully I got Logs as image

But As mentioned above On UI It shows Complete , but It shows Error: 400 - CustomExecutionError: Error retrieving references for the specified caseId and documentId. error while making Get request to fetch details using Postman and on UI as follows all Entity blank while API status is 200.

image image

mukitmomin commented 2 days ago

After uploading the document, you have to click start job to start the processing.

Komal-99 commented 2 days ago

Yes ik, Talking about API aspect, If I need to start the processing from the backend itself As I am Uploading Documents using Python API itself?