AX Glossary

A Comprehensive Guide to Data Parsing: From Definition to Process

HANCOM

What is Data Parsing?

Data parsing is a preprocessing step that converts unstructured or semi-structured data into structured data. For example, it involves organizing documents like contracts, reports, and PDFs into a format that AI can search or analyze. Parsing analyzes the semantic units of the source data and reconstructs them into a form that rules or models can process.

The Meaning of Parsing: Converting Unstructured/Semi-structured Data into Structured Data

Parsing is a data preprocessing stage that transforms unstructured or semi-structured data into machine-readable structured representations. It applies to various forms, from string separation to document structure restoration. Tasks such as dividing strings into fields, reading JSON documents into object structures, or distinguishing titles, body text, and tables in PDF documents are all included in parsing.

The key to parsing is not just extracting characters, but identifying their structural position within the document and how they connect to other elements.

For instance, if clause numbers and body text are separated in a contract, it becomes difficult to determine which content belongs to which clause. Similarly, if the structural relationship between table headers and cell data is broken, AI may struggle to identify which category a number belongs to, even if it reads the digit correctly.

Therefore, parsing is not merely text extraction; it is a preprocessing step that organizes the positions and connections of titles, body text, tables, and images within a document, much like creating a table of contents for a book.

An image comparing the difference between maintaining document structure and structural loss. An infographic contrasting a case where table header and data relationships are preserved versus a case where only text is extracted and structure is lost.
Maintaining document structure allows AI to understand the relationship between table headers and data, whereas extracting only text can make it difficult to distinguish the meaning of numbers.

How Data Parsing Works

Data parsing works by reading input data, analyzing its structure, extracting necessary information, and converting it into a structured format suitable for the intended purpose.

What is the Process of Data Parsing?

An infographic explaining the stages of AI document processing and data utilization. An image representing the flow of document input, document analysis, data extraction, and data utilization.

Data parsing proceeds through the stages of Document Input → Document Analysis → Data Extraction. In the document analysis stage, objects such as text, tables, and images are separated, and the reading order and hierarchical structure are identified. During this process, structured documents with consistent formats are analyzed using rule-based methods, while unstructured documents with complex structures, such as contracts, images, and scanned documents, are analyzed using AI-based methods.

In the data extraction stage, metadata, label information, and layout structures are extracted based on the identified structure and output in structured formats like JSON or HTML. For documents where accuracy is difficult to ensure through automated extraction alone, post-processing is performed to improve data quality. The structured data extracted this way is utilized in various ways, such as LLM model training and database construction.

📚 Recommended Reading

[What is VLM? Understanding Vision Language Models from Concept to Document AI Applications]

Types of Parsing Technology: Rule-based Parsing vs. AI-based Parsing

Parsing technology can be divided into rule-based parsing and AI-based parsing.

Rule-based parsing reads data structures according to predefined grammars and patterns. It is suitable for data with clear grammatical structures like JSON parsers or data with distinct repetitive patterns like standardized forms, reports, and system logs.

AI-based parsing is a method where models directly analyze data with significant structural variations, such as layouts, tables, and images. It is used for processing complex documents where table positions vary by document, scan quality is inconsistent, or multi-column layouts and images are mixed.

CategoryRule-based ParsingAI-based Parsing
Processing MethodAnalyzes data structure based on predefined rules, grammars, and patternsAnalyzes document layout, tables, images, and even contextual structure
Suitable DataStructured data with consistent formats like JSON, XML, applications, and system logsUnstructured/semi-structured data with varying structures like PDF, HWP, HWPX, and scanned documents
FeaturesAdvantageous for fast and stable repetitive processing, but error probability increases if the format changesAdvantageous for processing complex document structures, but can be affected by document quality and model performance

In actual enterprise environments, both methods are often used together. Structured documents are processed quickly using rule-based methods, while unstructured and semi-structured documents are supplemented with AI-based layout analysis, OCR, and table structure extraction technologies. As document structures become more complex, the process of analyzing layouts and table structures together becomes more important than simply extracting text.

Why Data Parsing is Difficult: Structural Differences by Format and Preprocessing Issues

Parsing unstructured and semi-structured data is difficult because internal structures vary by format, and they contain information that is hard to preserve through simple text extraction, such as tables, images, multi-column layouts, and hierarchical structures.

Different Parsing Strategies for Each Format
Unlike JSON parsing, which has clear rules, document parsing requires interpreting different structures for each format.

Why Parsing Strategies Differ by Data Format: From JSON to Document Formats

Because internal structures vary by data format, it is difficult to process all formats with a single parsing method. JSON is relatively simple to parse due to its key-value structure, but document formats like PDF, HWP, and HWPX have complex layouts, hierarchies, and table structures, requiring different preprocessing strategies for each format.

If a PDF is processed only as an image, values and item names within a table become separated, making it difficult to know which item a specific value belongs to.

Converting HWP or HWPX documents to PDF as a workaround can weaken original paragraph hierarchies and formatting information. OOXML also has different structures for documents, spreadsheets, and presentations, making them difficult to process in the same way. In the process of PDF text extraction or unstructured document structuring, a strategy is needed to understand the internal structure of each format and preserve the original layout and semantic information as much as possible.

Tables, Images, and Hierarchical Structures: Data Not Preserved by Text Extraction Alone

Simple text extraction struggles to preserve structural information that determines data context, such as merged cells, multi-column layouts, image captions, and title-body hierarchies. This is exactly why structured processing is necessary in unstructured data parsing.

Tables are a good example for checking document parsing quality. If the relationship between rows and columns is not preserved, the numbers remain, but it becomes difficult to tell which item those numbers represent. The same applies to hierarchical structures. If the hierarchy between titles and body text disappears, content from different sections can get mixed up, distorting the data context.

Why Data Parsing is Important in AI and RAG Environments

Data parsing is the process of organizing data so that AI can read and utilize it. Especially in AI systems like RAG that find documents to provide answers, search results and answer accuracy can vary depending on the parsing quality.

The Role of Data Parsing in AI/RAG Pipelines

In AI/RAG pipelines, data parsing is a preprocessing stage that organizes documents and data into a form that AI can read and search. In a RAG system, the flow typically follows ‘Document Upload → Parsing → Chunking → Embedding → Vector DB Storage → Search → Answer Generation,’ with parsing being the very first step. Much like organizing a book’s table of contents, it organizes the structure of titles, body text, tables, and images to help utilize information accurately in subsequent stages.

In fact, the Google Cloud Agent Search official documentation explains that layout parsers define the composition and hierarchy of documents to improve the quality of search and answer generation.

If the relationship between table headers and cell data is maintained during the parsing stage, it becomes easier to find values and item names together during the search process. Conversely, if parsing quality is low and paragraph hierarchies or table structures collapse, irrelevant content may be searched, or answers may be generated where it is difficult to distinguish the meaning of numbers.

📚 Recommended Reading

[What is RAG? From Chunking and Embedding to Vector DB – Understanding Every Stage of the Pipeline]

Problems Caused by Low Data Parsing Quality

If parsing quality is low, structural information is extracted incompletely, which can lead to contextual errors in subsequent AI processing stages. If row-column relationships in a table break, the numbers remain, but it becomes difficult to know which item they describe. If title hierarchies are missing, content from different sections can mix, making it hard to grasp the context.

Therefore, in AI utilization environments, the importance of parsing technology that analyzes data structure along with text extraction is growing.

Frequently Asked Questions (FAQ) About Data Parsing

Q1. What is data parsing?

Data parsing is a preprocessing step that converts unstructured or semi-structured data into structured data that AI can process. Tasks such as dividing strings into fields, reading JSON documents into object structures, or distinguishing titles, body text, and tables in PDF documents are all included in parsing. The core of parsing is not just extracting text, but preserving the position, context, and structure of the data.

Q2. Why do I need to parse documents separately for AI to read them?

OCR is a technology that converts characters within an image into text, while document parsing analyzes the overall structure, hierarchy, and semantic relationships of a document, converting them into structured data. If OCR focuses on reading what is written, parsing focuses on analyzing how it is arranged structurally.

Q3. How should I convert PDF, HWP, or HWPX documents to put them into RAG?

AI can process context more stably with data that maintains paragraph hierarchy, table structure, and positional relationships, rather than plain text. If documents are input via simple copy-pasting, table structures can break, and image context information may be lost. Document parsing is a preprocessing step that converts documents into a format AI can utilize while preserving this structural information.

Hancom Data Loader: A Parsing Solution that Preserves Original HWP Files

Image introducing key features of Hancom Data Loader. HWP/HWPX parsing, document structure analysis, TSR table extraction, and On-premise API support features.

🖥️ Hancom Data Loader

For unstructured and semi-structured documents with different internal structures for each format, simple text extraction can result in the loss of structural information for tables, hierarchies, and images. If parsing quality is low, AI will struggle to accurately grasp the context even when reading the same data. For AI to process data context correctly, a parsing solution that understands format-specific structures and preserves the original structure is required.

Hancom Data Loader is the only solution in Korea that fully supports HWP and HWPX, parsing the original binaries directly without PDF conversion. We support various document formats, including PDF, OOXML, and image formats, so please check the parsing results for yourself in our live demo.

👉 Inquire about Hancom Data Loader

👉 Test parsing with your own documents – Hancom Data Loader Live Demo


References

  1. arXiv, 「Document Parsing Unveiled: Techniques, Challenges, and Prospects for Structured Information Extraction」, 2024
  2. Google Cloud, 「Document Parsing and Chunking
  3. Google Cloud, 「Enterprise Document OCR
  4. Microsoft Learn, 「Choose the right Azure AI tool for document processing
  5. Unstructured, 「Introducing SCORE-Bench: An Open Benchmark for Document Parsing
  6. Hancom Tech, 「Hangul Document File Format: Parsing HWPX Format via Python (1)