nerdexam
Databricks

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.

Data Ingestion for RAG

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)
  • A
    4% (2)
  • B
    6% (3)
  • C
    77% (36)
  • D
    13% (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.

Aflask

Flask is a web application framework used to build HTTP APIs and has no document parsing capability.

Bbeautifulsoup

BeautifulSoup is an HTML and XML parsing library designed for web scraping, not for extracting content from binary PDF files.

CunstructuredCorrect

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.

Dnumpy

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

#RAG Applications#Document Parsing#Text Extraction#Python Libraries

Community Discussion

No community discussion yet for this question.

Full GENERATIVE-AI-ENGINEER-ASSOCIATE Practice