Document Extractor

Updated at:

Definition

The Document Extractor node parses documents in specific formats to extract text content. By transforming files into text, this node allows large models that do not support multimodal inputs to process text and helps reduce file processing costs.

For a list of supported document types, see below.

Prerequisites

Usage example

  1. Declare a variable for a single file or multiple files, such as `file`.

  2. Add a Document Extractor node and set the file variable as the input.

  3. You can add an end file.

  4. Enter a file address and run the test.

Supported document types

  • Text documents: Such as Markdown and TXT files.

  • Office Word documents: Excluding DOC files.

  • PDF documents.

  • Spreadsheet documents: Such as XLS, XLSX, and CSV files.

  • Documents in specialized formats: Such as YAML and JSON files.

Note

Content other than text, such as binary data, audio, or video, is not processed.

Input and output

  • The Document Extractor node accepts a single file or a list of files as input.

  • If the input is a single file, the output is a string of text content.

  • If the input is a list of files, the output is an array of strings containing the text content.

Common use cases

  • Extract text from documents for a large model to summarize, and use prompts to guide the model to extract specific information from files, such as contract clauses or the main points of a research paper.

  • Extract text from documents for analysis, indexing, or migration.

  • Store document content in a database or knowledge base.