Skip to main content

Intelligent Document Parsing and Chunking

Using BaiLian’s intelligent document parsing and chunking capabilities in LlamaIndex

BaiLian provides intelligent document parsing and chunking capabilities, compatible with LlamaIndex. It parses documents in various formats (e.g., PDF, Word, HTML) into structured content and performs semantic chunking.

Usage Example

from llama_index.indices.managed.dashscope import DashScopeDocumentParser

parser = DashScopeDocumentParser(
    api_key="your-api-key"
)

# Parse the document
documents = parser.load_data(file_path="document.pdf")

# Parsing and chunking are performed automatically
for doc in documents:
    print(doc.text[:100])

Supported File Formats

  • PDF
  • Word (.docx)
  • HTML
  • Markdown
  • Plain text (.txt)
  • Excel (.xlsx)