File Parser optimised for LLM Ingestion with no loss Parse PDFs, Docx, PPTx in a format that is ideal for LLMs.
File Parser optimised for LLM Ingestion with no loss Parse PDFs, Docx, PPTx in a format that is ideal for LLMs.
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.
https://github.com/QuivrHQ/MegaParse/assets/19614572/1b4cdb73-8dc2-44ef-b8b4-a7509bc8d4f3
required python version >= 3.11
pip install megaparseAdd 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)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.
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 !
| 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 .
Unauthenticated full-read SSRF via the parse-from-URL endpoint (POST /v1/url)
subprocess-exited-with-error
I can't use it in Chinese
How to use with languages with non-Latin characters?
ImportError: cannot import name 'PSSyntaxError' from 'pdfminer.pdfparser'
megaparse is currently unusable due to tightly coupled and broken dependencies
RuntimeError: uvloop does not support Windows at the moment
ETQ Agent, j'ai dans ma proposition de réponse une personnalisation grâce aux metadatas/tags lié au ticket
Error when testing code example for megaparsevision with Claude 3.5 Sonnet
Feature request: add OPENAI_API_BASE for method=megaparse_vision