Hello. I have a thousand pdf files currently sitting in my Nextcloud. I however would like to push them through a service like Amazon Comprehend. to get keywords and recognize relationships with other documents. So this will make it easier to tie documents together.
Does anyone know where I can start or find a way to do this? Do I just upload the files to Amazon myself and deal with what Amazon spits out? Or does it have to be a software connection? If so, which software would you recommend?
You can move the files from nextcloud to s3 programmatically. I found this online https://autoize.com/nextcloud-backup-to-s3-or-b2/
(I haven’t tested it personally so please take it with grain of salt)
Now that you have the files on s3 you can use the aws Iam (service roles) to ingest the files on comprehend and spit out the results wherever you want it.
The only thing I’d highly recommend is to ensure your s3 bucket permissions (bucket policies) are not wide open or open to public.
Thank you! That’s awesome I can easily import them! Do you know of an end software where I can easily view PDFs and see the related files it finds and all that? The only thing I can think of is SpringCM and they cost a fortune.
Just a point of clarification, IAM is not the mechanism ingesting files into Comprehend. IAM is the security mechanism which allows Comprehend access to the input and output buckets which contain the files for analysis.
The issue you may run into is that PDFs are not in UTF-8 format, which is the required input format of Comprehend. Basically, Comprehend will look at PDFs as binaries; not text. First, you’d need to convert the PDFs to text, and then process with Comprehend. For PDF to text conversion, have a look here: How to Batch Convert PDF Files to Text
I created this a while back. I’m using AWS Rekognition, but you can take this project and change it up to use Comprehend. You’re better off using S3 triggers to process your pdf. I also explain everything in detail here: