需自行安装 poppler 和 tesseract,macOS 还需 brew install libmagic;使用前要在 .env 里配置 OpenAI 或 Anthropic API key;MegaParseVision 只支持 claude 3.5、claude 4、gpt-4o、gpt-4 等多模态模型
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.
pip install megaparseREADME 未说明显存或 GPU 要求;MegaParseVision 需调用 OpenAI 或 Anthropic 的多模态模型 API。
面向 LLM 摄入的无损文档解析器,把 PDF、Word、PPT 转成适合大模型的格式
把 PDF、Word、PPT 解析成适合喂给大模型的格式,尽量不丢内容,省去自己清洗文档的麻烦。
核心能力
- 解析 PDF、PowerPoint、Word 等多种文档格式
- 保留表格、目录、页眉页脚和图片等内容
- 提供 MegaParseVision,用多模态模型转换文档
- 内置基准脚本,可对比不同解析器的相似度
- 可作为 API 服务启动,提供本地接口文档
容易踩的坑
- megaparse-v0.0.55megaparse: v0.0.55最新正式版2025-02-14 · 2025-02-14 09:24 UTC
- megaparse-sdk-v0.1.12megaparse-sdk: v0.1.122025-02-14 · 2025-02-14 08:15 UTC
- megaparse-sdk-v0.1.11megaparse-sdk: v0.1.112025-02-11 · 2025-02-11 16:38 UTC
- megaparse-v0.0.54megaparse: v0.0.542025-02-11 · 2025-02-11 16:37 UTC
- megaparse-v0.0.53megaparse: v0.0.532025-01-16 · 2025-01-16 20:56 UTC
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
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
-
Add your OpenAI or Anthropic API key to the .env file
-
Install poppler on your computer (images and PDFs)
-
Install tesseract on your computer (images and PDFs)
-
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
| Parser | similarity_ratio |
|---|---|
| megaparse_vision | 0.87 |
| unstructured_with_check_table | 0.77 |
| unstructured | 0.59 |
| llama_parser | 0.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 🤖