Parse data from documents optimised for downstream llm tasks.
Project description
LLM Parse
LLM Parse is a Python library designed for parsing and extracting data from files, specifically optimized for downstream tasks involving large language models (LLMs).
It is built on several popular document parsing libraries with further text processing to represent the data in a form that is more suitable for downstream LLM tasks such as RAG, summarization and drafting.
Getting started
Install the package:
pip install llm-parse
Examples
Parse a PDF to Markdown.
from llm_parse.pdf_2_md_parser import PDF2MDParser
parser = PDF2MDParser()
text = parser.load_data("example.pdf")
Parse a PDF to text.
from llm_parse.pdf_2_text_parser import PDF2TextParser
parser = PDF2TextParser()
text = parser.load_data("example.pdf")
Using LlamaParse parser.
from llm_parse.llamaparse_parser import LlamaParseParser
# can use any args for LlamaParse. ref: https://github.com/run-llama/llama_parse?tab=readme-ov-file#getting-started
parser = LlamaParseParser(
api_key="llx-...", # can also be set in your env as LLAMA_CLOUD_API_KEY
result_type="markdown", # "markdown" and "text" are available
num_workers=4, # if multiple files passed, split in `num_workers` API calls
verbose=True,
language="en", # Optionally you can define a language, default=en
)
text = parser.load_data("example.pdf")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
llm_parse-0.1.4.tar.gz
(8.8 kB
view details)
Built Distribution
llm_parse-0.1.4-py3-none-any.whl
(10.2 kB
view details)
File details
Details for the file llm_parse-0.1.4.tar.gz
.
File metadata
- Download URL: llm_parse-0.1.4.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.6 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b21a848b2c4ea633d7cd914cef89f86e0328e9cd6ccd353c9e1eb173df73bcbd |
|
MD5 | 0640eff18e5bbca178426d54e7accc8e |
|
BLAKE2b-256 | 6c296f511150f7856bd92b1e02e6b446499de21d46f934b0b2afd973ce68e475 |
File details
Details for the file llm_parse-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: llm_parse-0.1.4-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.6 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3aca8df3e9e6b26d79616c6aa7614c133c678486753895490cd263f2aa73c755 |
|
MD5 | ebc2988768874815a0831583a8c5aee9 |
|
BLAKE2b-256 | 87296243af432ede0cf401669e7992b913886564dac3248b1a5175453156f2e5 |