-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Describe the bug
After installing the predictions plugin to identify text for documents, and uploading a PDF, an error occurs: "Error: Unsupported document format".
To Reproduce
With a new ionic project
ionic start blank (add main and polyfill code)
amplify init
amplify add auth (defaults)
amplify add predictions -> identify -> Identify Text -> "Would you also like to identify documents?" Yes -> Auth and Guest users
try to identify a pdf
see error
import { Component } from '@angular/core';
import Predictions from '@aws-amplify/predictions';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
constructor() {}
onFileChange(event) {
const file = event.target.files[0];
console.log(file)
Predictions.identify({
text: {
source: {
file
},
format: "ALL"
}
}).then(event => {
console.log(event)
})
}
}
Expected behavior
Textract has an async function (start_document_analysis) for dealing with pdfs. I do not believe the current implementation allows for this. However, the "Would you also like to identify documents?" option seems like a question to allow for this.
Additional context
I'm not sure if this is creating a lambda function to handle the function. I can't seems to find the resource to switch to the async function.