megaparse

The-Vibe-CompanyApache-2.0活跃维护

把 PDF、Word、PPT 解析成适合喂给大模型的格式,尽量不丢内容,省去自己清洗文档的麻烦。

File Parser optimised for LLM Ingestion with no loss 🧠 Parse PDFs, Docx, PPTx in a format that is ideal for LLMs.

megaparse-v0.0.55发布于 2025-02-14 09:24 UTC7,419star +2 / 7 天416fork同步于 2026-11-11 05:31 UTC

怎么上手

由 README 提炼,执行前请确认
pip install megaparse
硬件要求按 README 说明

README 未说明显存或 GPU 要求;MegaParseVision 需调用 OpenAI 或 Anthropic 的多模态模型 API。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

面向 LLM 摄入的无损文档解析器,把 PDF、Word、PPT 转成适合大模型的格式

把 PDF、Word、PPT 解析成适合喂给大模型的格式,尽量不丢内容,省去自己清洗文档的麻烦。

核心能力

  • 解析 PDF、PowerPoint、Word 等多种文档格式
  • 保留表格、目录、页眉页脚和图片等内容
  • 提供 MegaParseVision,用多模态模型转换文档
  • 内置基准脚本,可对比不同解析器的相似度
  • 可作为 API 服务启动,提供本地接口文档

容易踩的坑

需自行安装 poppler 和 tesseract,macOS 还需 brew install libmagic;使用前要在 .env 里配置 OpenAI 或 Anthropic API key;MegaParseVision 只支持 claude 3.5、claude 4、gpt-4o、gpt-4 等多模态模型

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本megaparse-v0.0.55
  1. megaparse-v0.0.55megaparse: v0.0.55最新正式版2025-02-14 · 2025-02-14 09:24 UTC

    0.0.55 (2025-02-14)

    Features

  2. megaparse-sdk-v0.1.12megaparse-sdk: v0.1.122025-02-14 · 2025-02-14 08:15 UTC
    查看更新说明

    0.1.12 (2025-02-13)

    Features

  3. megaparse-sdk-v0.1.11megaparse-sdk: v0.1.112025-02-11 · 2025-02-11 16:38 UTC
    查看更新说明

    0.1.11 (2025-02-11)

    Features

    Bug Fixes

  4. megaparse-v0.0.54megaparse: v0.0.542025-02-11 · 2025-02-11 16:37 UTC
    查看更新说明

    0.0.54 (2025-02-11)

    Features

  5. megaparse-v0.0.53megaparse: v0.0.532025-01-16 · 2025-01-16 20:56 UTC
    查看更新说明

    0.0.53 (2025-01-16)

    Features

    Bug Fixes

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    MegaParse - Your Parser for every type of documents

    MegaParse is a powerful and versatile parser that can handle various types of documents with ease. Whether you're dealing with text, PDFs, Powerpoint presentations, Word documents MegaParse has got you covered. Focus on having no information loss during parsing.

    Key Features 🎯

    • Versatile Parser: MegaParse is a powerful and versatile parser that can handle various types of documents with ease.
    • No Information Loss: Focus on having no information loss during parsing.
    • Fast and Efficient: Designed with speed and efficiency at its core.
    • Wide File Compatibility: Supports Text, PDF, Powerpoint presentations, Excel, CSV, Word documents.
    • Open Source: Freedom is beautiful, and so is MegaParse. Open source and free to use.

    Support

    • Files: ✅ PDF ✅ Powerpoint ✅ Word
    • Content: ✅ Tables ✅ TOC ✅ Headers ✅ Footers ✅ Images

    Example

    https://github.com/QuivrHQ/MegaParse/assets/19614572/1b4cdb73-8dc2-44ef-b8b4-a7509bc8d4f3

    Installation

    required python version >= 3.11

    pip install megaparse
    

    Usage

    1. Add your OpenAI or Anthropic API key to the .env file

    2. Install poppler on your computer (images and PDFs)

    3. Install tesseract on your computer (images and PDFs)

    4. If you have a mac, you also need to install libmagic brew install libmagic

    Use MegaParse as it is :

    from megaparse import MegaParse
    from langchain_openai import ChatOpenAI
    
    megaparse = MegaParse()
    response = megaparse.load("./test.pdf")
    print(response)
    

    Use MegaParse Vision

    from megaparse.parser.megaparse_vision import MegaParseVision
    
    model = ChatOpenAI(model="gpt-4o", api_key=os.getenv("OPENAI_API_KEY"))  # type: ignore
    parser = MegaParseVision(model=model)
    response = parser.convert("./test.pdf")
    print(response)
    
    

    Note: The model supported by MegaParse Vision are the multimodal ones such as claude 3.5, claude 4, gpt-4o and gpt-4.

    Use as an API

    There is a MakeFile for you, simply use : make dev at the root of the project and you are good to go.

    See localhost:8000/docs for more info on the different endpoints !

    BenchMark

    Parsersimilarity_ratio
    megaparse_vision0.87
    unstructured_with_check_table0.77
    unstructured0.59
    llama_parser0.33

    Higher the better

    Note: Want to evaluate and compare your Megaparse module with ours ? Please add your config in evaluations/script.py and then run python evaluations/script.py. If it is better, do a PR, I mean, let's go higher together .

    In Construction 🚧

    • Improve table checker
    • Create Checkers to add modular postprocessing ⚙️
    • Add Structured output, let's get computer talking 🤖

    Star History

    Star History Chart