Skip to main content

RAG dataset generator

Project description

RAGGen - RAG Dataset Generator

A universal tool for converting files into high-quality RAG datasets.

Features

  • Supports a variety of commonly used formats for storing textual data.
  • Robust PDF parsing with OCR utilizing marker library.
  • Preserves headers, supports fixing header levels using LLM (OpenAI API).
  • Respects tables, does not split them into chunks.
  • Supports embedding metadata directly into chunk text.
  • Supports adding custom metadata for each input.
  • Multiple input formats, standard output format.
  • Checksum-based result caching.

Supported formats

Installation

pip install raggen

Usage

from raggen import RAGGen

# Initialize RAGGen
gen = RAGGen(cache_dir="cache")

# Define inputs
inputs = ["sample1.pdf", "sample2.html", "sample3.md"]

# Input with custom metadata
inputs.append({"path": "sample4.docx", "metadata": {"title": "Doc title"}})

# Generate RAG dataset as list
data = gen(inputs)

# Generate RAG dataset as pandas DataFrame
data = gen.generate_dataset(inputs)

TODO

  • Save images
  • Add proper documentation
  • Add more usage examples
  • Add txt support
  • Add Power Point support
  • Add Excel support
  • Add support for reading files from buffer

Contribution

Feel free to fork this repo and make pull requests.

If you like my work, please, support me:

BTC: 32F3zAnQQGwZzsG7R35rPUS269Xz11cZ8B

Lisense

Free to use under Apache-2.0. See LICENSE for more information.

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

raggen-0.1.2.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

raggen-0.1.2-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file raggen-0.1.2.tar.gz.

File metadata

  • Download URL: raggen-0.1.2.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for raggen-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4fdaf31af7a8e30e94e7ce309b8e94fc49999fe98858dcf887e1ee50f573d0f6
MD5 7f518506f88d8e60d92b84e5afecd555
BLAKE2b-256 bcc94c6c1c8883b60999401c826f8695da5488570c21d3687496d02f16bff816

See more details on using hashes here.

File details

Details for the file raggen-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: raggen-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for raggen-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 10d078eab8c00dc872f283444a8a968ccdee63ac1feb8d37fa639bb5e7593645
MD5 de6eedf8c9983b177204a5c87a2f1579
BLAKE2b-256 06ea7e95a3aade674ec367f58ca6fe557e364011bdc47d8e5e3ef57dd8793985

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page