GENERATIVE-AI-ENGINEER-ASSOCIATE · Question #92
A Generative AI Engineer is building a RAG application that will rely on context retrieved from source documents that are currently in PDF format. These PDFs can contain both text and images. They…
The correct answer is C. unstructured. The unstructured library is purpose-built to extract text and other content from PDFs and many other document formats with minimal code.
Question
A Generative AI Engineer is building a RAG application that will rely on context retrieved from source documents that are currently in PDF format. These PDFs can contain both text and images. They want to develop a solution using the least amount of lines of code. Which Python package should be used to extract the text from the source documents?
Options
- Aflask
- Bbeautifulsoup
- Cunstructured
- Dnumpy
How the community answered
(47 responses)- A4% (2)
- B6% (3)
- C77% (36)
- D13% (6)
Why each option
The unstructured library is purpose-built to extract text and other content from PDFs and many other document formats with minimal code.
Flask is a web application framework used to build HTTP APIs and has no document parsing capability.
BeautifulSoup is an HTML and XML parsing library designed for web scraping, not for extracting content from binary PDF files.
The unstructured Python package provides a high-level API for parsing PDFs (including embedded images via OCR), DOCX, HTML, and other formats with just a few lines of code, making it the least-effort solution for extracting text from mixed-content PDFs.
NumPy is a numerical computing library for array operations and mathematical functions, with no document parsing functionality.
Concept tested: PDF text extraction using the unstructured library
Source: https://docs.unstructured.io/open-source/introduction/overview
Topics
Community Discussion
No community discussion yet for this question.